Skip to main content

Module files

Module files 

Source

Re-exportsΒ§

use std::any::Any; πŸ”’
use std::collections::BTreeMap; πŸ”’
use std::convert::BoundedCastFromInt; πŸ”’ Experimental
use std::fs::Dir; πŸ”’ Experimental
use std::fs::File; πŸ”’
use std::io::ErrorKind; πŸ”’
use std::io::IsTerminal; πŸ”’
use std::io::Read; πŸ”’
use std::io::Seek; πŸ”’
use std::io::SeekFrom; πŸ”’
use std::io::Write; πŸ”’
use std::marker::CoercePointee; πŸ”’ Experimental
use std::ops::Deref; πŸ”’
use std::rc::Rc; πŸ”’
use std::rc::Weak; πŸ”’
use std::fs; πŸ”’
use std::io; πŸ”’
use rustc_abi::Size; πŸ”’
use crate::shims::unix::UnixFileDescription; πŸ”’
use crate::*; πŸ”’

StructsΒ§

DirHandle
FdId
A unique id for file descriptions. While we could use the address, considering that is definitely unique, the address would expose interpreter internal state when used for sorting things. So instead we generate a unique id per file description which is the same for all duplicates and is never reused.
FdIdWith πŸ”’
FdTable
The file descriptor table
FileDescriptionRef
A refcounted pointer to a file description, also tracking the globally unique ID of this file description.
FileHandle
NullOutput
Like /dev/null
Stderr
Stdin
Stdout
WeakFileDescriptionRef
Holds a weak reference to the actual file description.

ConstantsΒ§

BIG_ACCESS
Accesses this large have a higher chance of being shortened. We use twice the usual page size, which means the shortened access is at least a page.
FD_LIMIT
The maximum number of open FDs.

TraitsΒ§

EvalContextExt
FileDescription
Represents an open file description.
FileDescriptionExt
A helper trait to indirectly allow downcasting on Rc<FdIdWith<dyn _>>. Ideally we’d just add a FdIdWith<Self>: Any bound to the FileDescription trait, but that does not allow upcasting.

FunctionsΒ§

open_file_or_dir
Open something for which we don’t know ahead of time whether it is a file or a directory.

Type AliasesΒ§

DynFileDescriptionRef
FdNum
Internal type of a file-descriptor - this is what FdTable expects
WeakDynFileDescriptionRef