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) -> bool { ... }
fn as_unix_host_fd(&self) -> Option<i32> { ... }
}