pub struct UrandomDev { /* private fields */ }
Expand description
A urandom device behaves like /dev/urandom
.
It produces random bytes when read.
Implementations§
Trait Implementations§
Source§impl Default for UrandomDev
impl Default for UrandomDev
Source§impl VfsNodeOps for UrandomDev
impl VfsNodeOps for UrandomDev
Source§fn get_attr(&self) -> VfsResult<VfsNodeAttr>
fn get_attr(&self) -> VfsResult<VfsNodeAttr>
Get the attributes of the node.
Source§fn read_at(&self, _offset: u64, buf: &mut [u8]) -> VfsResult<usize>
fn read_at(&self, _offset: u64, buf: &mut [u8]) -> VfsResult<usize>
Read data from the file at the given offset.
Source§fn write_at(&self, _offset: u64, buf: &[u8]) -> VfsResult<usize>
fn write_at(&self, _offset: u64, buf: &[u8]) -> VfsResult<usize>
Write data to the file at the given offset.
Source§fn lookup(self: Arc<Self>, _path: &str) -> VfsResult<VfsNodeRef>
fn lookup(self: Arc<Self>, _path: &str) -> VfsResult<VfsNodeRef>
Lookup the node with given
path
in the directory. Read moreSource§fn create(&self, _path: &str, _ty: VfsNodeType) -> VfsResult
fn create(&self, _path: &str, _ty: VfsNodeType) -> VfsResult
Create a new node with the given
path
in the directory Read moreSource§fn remove(&self, _path: &str) -> VfsResult
fn remove(&self, _path: &str) -> VfsResult
Remove the node with the given
path
in the directory.Source§fn read_dir(
&self,
_start_idx: usize,
_dirents: &mut [VfsDirEntry],
) -> VfsResult<usize>
fn read_dir( &self, _start_idx: usize, _dirents: &mut [VfsDirEntry], ) -> VfsResult<usize>
Read directory entries into
dirents
, starting from start_idx
.Auto Trait Implementations§
impl !Freeze for UrandomDev
impl RefUnwindSafe for UrandomDev
impl Send for UrandomDev
impl Sync for UrandomDev
impl Unpin for UrandomDev
impl UnwindSafe for UrandomDev
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more