pub struct Input { /* private fields */ }Expand description
What a reader is asked to open: a path in a namespace of files. For a local file the path is the real path and the namespace is the file system; for a buffer or a host source the path is the name the host gave it (its extension still guides detection).
Implementations§
Source§impl Input
impl Input
Sourcepub fn from_bytes(
name: impl AsRef<Path>,
data: impl AsRef<[u8]> + Send + Sync + 'static,
) -> Self
pub fn from_bytes( name: impl AsRef<Path>, data: impl AsRef<[u8]> + Send + Sync + 'static, ) -> Self
One file held in memory, named name.
Sourcepub fn from_source(name: impl AsRef<Path>, src: Arc<dyn ByteSource>) -> Self
pub fn from_source(name: impl AsRef<Path>, src: Arc<dyn ByteSource>) -> Self
One file read through src (a host callback, a cached remote reader), named name.
Sourcepub fn with_path(&self, path: impl Into<PathBuf>) -> Self
pub fn with_path(&self, path: impl Into<PathBuf>) -> Self
Another path in the same namespace (a sibling file, a member of a directory dataset).
Sourcepub fn open(&self) -> Result<SourceFile>
pub fn open(&self) -> Result<SourceFile>
Open the input’s file; errors name its path (exit 5).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Input
impl !UnwindSafe for Input
impl Freeze for Input
impl Send for Input
impl Sync for Input
impl Unpin for Input
impl UnsafeUnpin for Input
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more