Trait miri::shims::unix::fd::FileDescriptor

source ·
pub trait FileDescriptor: Debug + Any {
    // Required methods
    fn name(&self) -> &'static str;
    fn dup(&mut self) -> Result<Box<dyn FileDescriptor>>;

    // Provided methods
    fn read<'tcx>(
        &mut self,
        _communicate_allowed: bool,
        _bytes: &mut [u8],
        _tcx: TyCtxt<'tcx>
    ) -> InterpResult<'tcx, Result<usize>> { ... }
    fn write<'tcx>(
        &self,
        _communicate_allowed: bool,
        _bytes: &[u8],
        _tcx: TyCtxt<'tcx>
    ) -> InterpResult<'tcx, Result<usize>> { ... }
    fn seek<'tcx>(
        &mut self,
        _communicate_allowed: bool,
        _offset: SeekFrom
    ) -> InterpResult<'tcx, Result<u64>> { ... }
    fn close<'tcx>(
        self: Box<Self>,
        _communicate_allowed: bool
    ) -> InterpResult<'tcx, Result<i32>> { ... }
    fn is_tty(&self, _communicate_allowed: bool) -> bool { ... }
}
Expand description

Represents an open file descriptor.

Required Methods§

source

fn name(&self) -> &'static str

source

fn dup(&mut self) -> Result<Box<dyn FileDescriptor>>

Return a new file descriptor that refers to the same underlying object.

Provided Methods§

source

fn read<'tcx>( &mut self, _communicate_allowed: bool, _bytes: &mut [u8], _tcx: TyCtxt<'tcx> ) -> InterpResult<'tcx, Result<usize>>

source

fn write<'tcx>( &self, _communicate_allowed: bool, _bytes: &[u8], _tcx: TyCtxt<'tcx> ) -> InterpResult<'tcx, Result<usize>>

source

fn seek<'tcx>( &mut self, _communicate_allowed: bool, _offset: SeekFrom ) -> InterpResult<'tcx, Result<u64>>

source

fn close<'tcx>( self: Box<Self>, _communicate_allowed: bool ) -> InterpResult<'tcx, Result<i32>>

source

fn is_tty(&self, _communicate_allowed: bool) -> bool

Implementations§

source§

impl dyn FileDescriptor

source

pub fn downcast_ref<T: Any>(&self) -> Option<&T>

source

pub fn downcast_mut<T: Any>(&mut self) -> Option<&mut T>

Implementations on Foreign Types§

source§

impl FileDescriptor for Stderr

source§

fn name(&self) -> &'static str

source§

fn write<'tcx>( &self, _communicate_allowed: bool, bytes: &[u8], _tcx: TyCtxt<'tcx> ) -> InterpResult<'tcx, Result<usize>>

source§

fn dup(&mut self) -> Result<Box<dyn FileDescriptor>>

source§

fn is_tty(&self, communicate_allowed: bool) -> bool

source§

impl FileDescriptor for Stdin

source§

fn name(&self) -> &'static str

source§

fn read<'tcx>( &mut self, communicate_allowed: bool, bytes: &mut [u8], _tcx: TyCtxt<'tcx> ) -> InterpResult<'tcx, Result<usize>>

source§

fn dup(&mut self) -> Result<Box<dyn FileDescriptor>>

source§

fn is_tty(&self, communicate_allowed: bool) -> bool

source§

impl FileDescriptor for Stdout

source§

fn name(&self) -> &'static str

source§

fn write<'tcx>( &self, _communicate_allowed: bool, bytes: &[u8], _tcx: TyCtxt<'tcx> ) -> InterpResult<'tcx, Result<usize>>

source§

fn dup(&mut self) -> Result<Box<dyn FileDescriptor>>

source§

fn is_tty(&self, communicate_allowed: bool) -> bool

Implementors§