⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

PtySlaveNode

Struct PtySlaveNode 

Source
pub struct PtySlaveNode { /* private fields */ }
Expand description

VfsNode adapter for the slave side of a PTY.

Reading from this node returns bytes that the master has written (i.e. keyboard input forwarded to the shell). Writing to this node sends bytes to the master’s output buffer (the program’s output visible in the terminal emulator).

Implementations§

Source§

impl PtySlaveNode

Source

pub fn new(slave: PtySlave) -> Self

Wrap a PtySlave as a VfsNode.

Source

pub fn pty_id(&self) -> u32

Return the PTY ID of this slave.

Source

pub fn pts_path(&self) -> String

Return the path that would be exposed as the slave device name.

Trait Implementations§

Source§

impl VfsNode for PtySlaveNode

Source§

fn read(&self, _offset: usize, buffer: &mut [u8]) -> Result<usize, KernelError>

Read bytes that the master wrote (keyboard input / program stdin).

Source§

fn write(&self, _offset: usize, data: &[u8]) -> Result<usize, KernelError>

Write bytes that the master will read (program output / terminal output).

Source§

fn node_type(&self) -> NodeType

Node type query (also serves as vtable slot padding for AArch64)
Source§

fn metadata(&self) -> Result<Metadata, KernelError>

Get metadata for the node
Source§

fn readdir(&self) -> Result<Vec<DirEntry>, KernelError>

List directory entries (if this is a directory)
Source§

fn lookup(&self, _name: &str) -> Result<Arc<dyn VfsNode>, KernelError>

Look up a child node by name (if this is a directory)
Source§

fn create( &self, _name: &str, _permissions: Permissions, ) -> Result<Arc<dyn VfsNode>, KernelError>

Create a new file in this directory
Source§

fn mkdir( &self, _name: &str, _permissions: Permissions, ) -> Result<Arc<dyn VfsNode>, KernelError>

Create a new directory in this directory
Remove a file or empty directory
Source§

fn truncate(&self, _size: usize) -> Result<(), KernelError>

Truncate the file to the specified size
Create a hard link to this node
Create a symbolic link in this directory. Read more
Read the target of a symbolic link. Read more
Source§

fn chmod(&self, _permissions: Permissions) -> Result<(), KernelError>

Change permissions on this node
Source§

fn poll_readiness(&self) -> u16

Poll readiness for I/O multiplexing (poll/epoll). Read more
Source§

fn as_any(&self) -> Option<&dyn Any>

Downcast to &dyn core::any::Any for type-specific operations. Read more

Auto Trait Implementations§

§

impl Freeze for PtySlaveNode

§

impl RefUnwindSafe for PtySlaveNode

§

impl Send for PtySlaveNode

§

impl Sync for PtySlaveNode

§

impl Unpin for PtySlaveNode

§

impl UnwindSafe for PtySlaveNode

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.