pub trait FileDescription: Debug + Any {
// Required method
fn name(&self) -> &'static str;
// Provided methods
fn read<'tcx>(
&self,
_self_ref: &FileDescriptionRef,
_communicate_allowed: bool,
_bytes: &mut [u8],
_ecx: &mut MiriInterpCx<'tcx>,
) -> InterpResult<'tcx, Result<usize>> { ... }
fn write<'tcx>(
&self,
_self_ref: &FileDescriptionRef,
_communicate_allowed: bool,
_bytes: &[u8],
_ecx: &mut MiriInterpCx<'tcx>,
) -> InterpResult<'tcx, Result<usize>> { ... }
fn pread<'tcx>(
&self,
_communicate_allowed: bool,
_bytes: &mut [u8],
_offset: u64,
_ecx: &mut MiriInterpCx<'tcx>,
) -> InterpResult<'tcx, Result<usize>> { ... }
fn pwrite<'tcx>(
&self,
_communicate_allowed: bool,
_bytes: &[u8],
_offset: u64,
_ecx: &mut MiriInterpCx<'tcx>,
) -> InterpResult<'tcx, Result<usize>> { ... }
fn seek<'tcx>(
&self,
_communicate_allowed: bool,
_offset: SeekFrom,
) -> InterpResult<'tcx, Result<u64>> { ... }
fn close<'tcx>(
self: Box<Self>,
_communicate_allowed: bool,
_ecx: &mut MiriInterpCx<'tcx>,
) -> InterpResult<'tcx, Result<()>> { ... }
fn flock<'tcx>(
&self,
_communicate_allowed: bool,
_op: FlockOp,
) -> InterpResult<'tcx, Result<()>> { ... }
fn is_tty(&self, _communicate_allowed: bool) -> bool { ... }
fn get_epoll_ready_events<'tcx>(
&self,
) -> InterpResult<'tcx, EpollReadyEvents> { ... }
}
Expand description
Represents an open file descriptor.
Required Methods§
Provided Methods§
sourcefn read<'tcx>(
&self,
_self_ref: &FileDescriptionRef,
_communicate_allowed: bool,
_bytes: &mut [u8],
_ecx: &mut MiriInterpCx<'tcx>,
) -> InterpResult<'tcx, Result<usize>>
fn read<'tcx>( &self, _self_ref: &FileDescriptionRef, _communicate_allowed: bool, _bytes: &mut [u8], _ecx: &mut MiriInterpCx<'tcx>, ) -> InterpResult<'tcx, Result<usize>>
Reads as much as possible into the given buffer, and returns the number of bytes read.
sourcefn write<'tcx>(
&self,
_self_ref: &FileDescriptionRef,
_communicate_allowed: bool,
_bytes: &[u8],
_ecx: &mut MiriInterpCx<'tcx>,
) -> InterpResult<'tcx, Result<usize>>
fn write<'tcx>( &self, _self_ref: &FileDescriptionRef, _communicate_allowed: bool, _bytes: &[u8], _ecx: &mut MiriInterpCx<'tcx>, ) -> InterpResult<'tcx, Result<usize>>
Writes as much as possible from the given buffer, and returns the number of bytes written.
sourcefn pread<'tcx>(
&self,
_communicate_allowed: bool,
_bytes: &mut [u8],
_offset: u64,
_ecx: &mut MiriInterpCx<'tcx>,
) -> InterpResult<'tcx, Result<usize>>
fn pread<'tcx>( &self, _communicate_allowed: bool, _bytes: &mut [u8], _offset: u64, _ecx: &mut MiriInterpCx<'tcx>, ) -> InterpResult<'tcx, Result<usize>>
Reads as much as possible into the given buffer from a given offset, and returns the number of bytes read.
sourcefn pwrite<'tcx>(
&self,
_communicate_allowed: bool,
_bytes: &[u8],
_offset: u64,
_ecx: &mut MiriInterpCx<'tcx>,
) -> InterpResult<'tcx, Result<usize>>
fn pwrite<'tcx>( &self, _communicate_allowed: bool, _bytes: &[u8], _offset: u64, _ecx: &mut MiriInterpCx<'tcx>, ) -> InterpResult<'tcx, Result<usize>>
Writes as much as possible from the given buffer starting at a given offset, and returns the number of bytes written.
sourcefn seek<'tcx>(
&self,
_communicate_allowed: bool,
_offset: SeekFrom,
) -> InterpResult<'tcx, Result<u64>>
fn seek<'tcx>( &self, _communicate_allowed: bool, _offset: SeekFrom, ) -> InterpResult<'tcx, Result<u64>>
Seeks to the given offset (which can be relative to the beginning, end, or current position). Returns the new position from the start of the stream.
fn close<'tcx>( self: Box<Self>, _communicate_allowed: bool, _ecx: &mut MiriInterpCx<'tcx>, ) -> InterpResult<'tcx, Result<()>>
fn flock<'tcx>( &self, _communicate_allowed: bool, _op: FlockOp, ) -> InterpResult<'tcx, Result<()>>
fn is_tty(&self, _communicate_allowed: bool) -> bool
sourcefn get_epoll_ready_events<'tcx>(&self) -> InterpResult<'tcx, EpollReadyEvents>
fn get_epoll_ready_events<'tcx>(&self) -> InterpResult<'tcx, EpollReadyEvents>
Check the readiness of file description.