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§
Trait Implementations§
Source§impl VfsNode for PtySlaveNode
impl VfsNode for PtySlaveNode
Source§fn read(&self, _offset: usize, buffer: &mut [u8]) -> Result<usize, KernelError>
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>
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
fn node_type(&self) -> NodeType
Node type query (also serves as vtable slot padding for AArch64)
Source§fn metadata(&self) -> Result<Metadata, KernelError>
fn metadata(&self) -> Result<Metadata, KernelError>
Get metadata for the node
Source§fn readdir(&self) -> Result<Vec<DirEntry>, KernelError>
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>
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>
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>
fn mkdir( &self, _name: &str, _permissions: Permissions, ) -> Result<Arc<dyn VfsNode>, KernelError>
Create a new directory in this directory
Source§fn unlink(&self, _name: &str) -> Result<(), KernelError>
fn unlink(&self, _name: &str) -> Result<(), KernelError>
Remove a file or empty directory
Source§fn truncate(&self, _size: usize) -> Result<(), KernelError>
fn truncate(&self, _size: usize) -> Result<(), KernelError>
Truncate the file to the specified size
Source§fn link(
&self,
_name: &str,
_target: Arc<dyn VfsNode>,
) -> Result<(), KernelError>
fn link( &self, _name: &str, _target: Arc<dyn VfsNode>, ) -> Result<(), KernelError>
Create a hard link to this node
Source§fn symlink(
&self,
_name: &str,
_target: &str,
) -> Result<Arc<dyn VfsNode>, KernelError>
fn symlink( &self, _name: &str, _target: &str, ) -> Result<Arc<dyn VfsNode>, KernelError>
Create a symbolic link in this directory. Read more
Source§fn readlink(&self) -> Result<String, KernelError>
fn readlink(&self) -> Result<String, KernelError>
Read the target of a symbolic link. Read more
Source§fn chmod(&self, _permissions: Permissions) -> Result<(), KernelError>
fn chmod(&self, _permissions: Permissions) -> Result<(), KernelError>
Change permissions on this node
Source§fn poll_readiness(&self) -> u16
fn poll_readiness(&self) -> u16
Poll readiness for I/O multiplexing (poll/epoll). Read more