Enum tectonic::io::OpenResult
source · pub enum OpenResult<T> {
Ok(T),
NotAvailable,
Err(Error),
}
Expand description
A convenience type for file-open operations when “not found” needs to be handled specially.
Variants§
Ok(T)
The open operation succeeded.
NotAvailable
The file was not available.
Err(Error)
Something else went wrong.
Implementations§
source§impl<T> OpenResult<T>
impl<T> OpenResult<T>
sourcepub fn is_not_available(&self) -> bool
pub fn is_not_available(&self) -> bool
Returns true if this result is of the NotAvailable variant.
sourcepub fn must_exist(self) -> Result<T, Error>
pub fn must_exist(self) -> Result<T, Error>
Convert this object into a plain Result, erroring if the item was not available.
Trait Implementations§
Auto Trait Implementations§
impl<T> RefUnwindSafe for OpenResult<T>where
T: RefUnwindSafe,
impl<T> Send for OpenResult<T>where
T: Send,
impl<T> Sync for OpenResult<T>where
T: Sync,
impl<T> Unpin for OpenResult<T>where
T: Unpin,
impl<T> UnwindSafe for OpenResult<T>where
T: UnwindSafe,
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