pub enum DecodeAsTypeResult<V, R> {
Skipped(V),
Decoded(R),
}
Expand description
The response from Visitor::unchecked_decode_as_type()
.
Variants§
Skipped(V)
Skip any manual decoding and return the visitor instead.
Decoded(R)
Some manually decoded result.
Implementations§
source§impl<V, R> DecodeAsTypeResult<V, R>
impl<V, R> DecodeAsTypeResult<V, R>
sourcepub fn map_decoded<T, F: FnOnce(R) -> T>(self, f: F) -> DecodeAsTypeResult<V, T>
pub fn map_decoded<T, F: FnOnce(R) -> T>(self, f: F) -> DecodeAsTypeResult<V, T>
If we have a DecodeAsTypeResult::Decoded
, the function provided will
map this decoded result to whatever it returns.
sourcepub fn map_skipped<T, F: FnOnce(V) -> T>(self, f: F) -> DecodeAsTypeResult<T, R>
pub fn map_skipped<T, F: FnOnce(V) -> T>(self, f: F) -> DecodeAsTypeResult<T, R>
If we have a DecodeAsTypeResult::Skipped
, the function provided will
map this skipped value to whatever it returns.
Auto Trait Implementations§
impl<V, R> Freeze for DecodeAsTypeResult<V, R>
impl<V, R> RefUnwindSafe for DecodeAsTypeResult<V, R>where
V: RefUnwindSafe,
R: RefUnwindSafe,
impl<V, R> Send for DecodeAsTypeResult<V, R>
impl<V, R> Sync for DecodeAsTypeResult<V, R>
impl<V, R> Unpin for DecodeAsTypeResult<V, R>
impl<V, R> UnwindSafe for DecodeAsTypeResult<V, R>where
V: UnwindSafe,
R: 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