pub enum TryParse<T, P: PathType + ?Sized> {
Success(T),
Failure(Error<P::OwnedPath>),
}Expand description
A type that tries to parse a value of type T, but doesn’t fail if it can’t.
Instead, it keeps the original Error.
Variants§
Success(T)
Successfully parsed a value of type T.
Failure(Error<P::OwnedPath>)
Failed to parse a value of type T.
Trait Implementations§
Source§impl<'vfs, Vfs, T, P> ReadFromAsync<'vfs, Vfs> for TryParse<T, P>where
P: PathType + 'vfs,
Vfs: VfsAsync<Path = P> + 'vfs,
T: ReadFromAsync<'vfs, Vfs> + Send + 'vfs,
Available on crate feature async only.
impl<'vfs, Vfs, T, P> ReadFromAsync<'vfs, Vfs> for TryParse<T, P>where
P: PathType + 'vfs,
Vfs: VfsAsync<Path = P> + 'vfs,
T: ReadFromAsync<'vfs, Vfs> + Send + 'vfs,
Available on crate feature
async only.Source§impl<'vfs, Vfs, T, P> WriteToAsync<'vfs, Vfs> for TryParse<T, P>where
P: PathType + ?Sized + 'vfs,
Vfs: WriteSupportingVfsAsync<Path = P> + 'vfs,
T: WriteToAsync<'vfs, Vfs> + Send + 'vfs,
<T as WriteToAsync<'vfs, Vfs>>::Future: Future<Output = VfsResult<(), Vfs>> + Unpin,
Available on crate feature async only.
impl<'vfs, Vfs, T, P> WriteToAsync<'vfs, Vfs> for TryParse<T, P>where
P: PathType + ?Sized + 'vfs,
Vfs: WriteSupportingVfsAsync<Path = P> + 'vfs,
T: WriteToAsync<'vfs, Vfs> + Send + 'vfs,
<T as WriteToAsync<'vfs, Vfs>>::Future: Future<Output = VfsResult<(), Vfs>> + Unpin,
Available on crate feature
async only.Source§impl<'vfs, Vfs, T, P> WriteToAsyncRef<'vfs, Vfs> for TryParse<T, P>where
P: PathType + ?Sized + 'vfs,
Vfs: WriteSupportingVfsAsync<Path = P> + 'static,
T: WriteToAsyncRef<'vfs, Vfs> + Send + 'vfs,
for<'a> <T as WriteToAsyncRef<'vfs, Vfs>>::Future<'a>: Future<Output = VfsResult<(), Vfs>> + Send + Sync + Unpin + 'a,
Available on crate feature async only.
impl<'vfs, Vfs, T, P> WriteToAsyncRef<'vfs, Vfs> for TryParse<T, P>where
P: PathType + ?Sized + 'vfs,
Vfs: WriteSupportingVfsAsync<Path = P> + 'static,
T: WriteToAsyncRef<'vfs, Vfs> + Send + 'vfs,
for<'a> <T as WriteToAsyncRef<'vfs, Vfs>>::Future<'a>: Future<Output = VfsResult<(), Vfs>> + Send + Sync + Unpin + 'a,
Available on crate feature
async only.Auto Trait Implementations§
impl<T, P> Freeze for TryParse<T, P>
impl<T, P> !RefUnwindSafe for TryParse<T, P>
impl<T, P> Send for TryParse<T, P>
impl<T, P> Sync for TryParse<T, P>
impl<T, P> Unpin for TryParse<T, P>
impl<T, P> !UnwindSafe for TryParse<T, P>
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> DirStructureItem for T
impl<T> DirStructureItem for T
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