pub enum DecodeDifferent<B, O>where
B: 'static,
O: 'static,{
Encode(B),
Decoded(O),
}Expand description
A type that decodes to a different type than it encodes. The user needs to make sure that both types use the same encoding.
For example a &'static [ &'static str ] can be decoded to a Vec<String>.
Variants§
Trait Implementations§
Source§impl<B, O> Clone for DecodeDifferent<B, O>
impl<B, O> Clone for DecodeDifferent<B, O>
Source§fn clone(&self) -> DecodeDifferent<B, O>
fn clone(&self) -> DecodeDifferent<B, O>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<B, O> Debug for DecodeDifferent<B, O>
impl<B, O> Debug for DecodeDifferent<B, O>
Source§impl<B, O> Decode for DecodeDifferent<B, O>where
B: 'static,
O: Decode + 'static,
Available on crate feature std only.
impl<B, O> Decode for DecodeDifferent<B, O>where
B: 'static,
O: Decode + 'static,
Available on crate feature
std only.Source§impl<B, O> Encode for DecodeDifferent<B, O>
impl<B, O> Encode for DecodeDifferent<B, O>
Source§fn encode_to<W: Output + ?Sized>(&self, dest: &mut W)
fn encode_to<W: Output + ?Sized>(&self, dest: &mut W)
Convert self to a slice and append it to the destination.
Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
Source§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
Source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
impl<B, O> EncodeLike for DecodeDifferent<B, O>
impl<B, O> Eq for DecodeDifferent<B, O>
Source§impl<B, O> PartialEq for DecodeDifferent<B, O>
impl<B, O> PartialEq for DecodeDifferent<B, O>
Auto Trait Implementations§
impl<B, O> Freeze for DecodeDifferent<B, O>
impl<B, O> RefUnwindSafe for DecodeDifferent<B, O>where
B: RefUnwindSafe,
O: RefUnwindSafe,
impl<B, O> Send for DecodeDifferent<B, O>
impl<B, O> Sync for DecodeDifferent<B, O>
impl<B, O> Unpin for DecodeDifferent<B, O>
impl<B, O> UnsafeUnpin for DecodeDifferent<B, O>where
B: UnsafeUnpin,
O: UnsafeUnpin,
impl<B, O> UnwindSafe for DecodeDifferent<B, O>where
B: UnwindSafe,
O: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S> Codec for S
Source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> EncodeLike<&&T> for Twhere
T: Encode,
impl<T> EncodeLike<&T> for Twhere
T: Encode,
impl<T> EncodeLike<&mut T> for Twhere
T: Encode,
impl<T> EncodeLike<Arc<T>> for Twhere
T: Encode,
impl<T> EncodeLike<Box<T>> for Twhere
T: Encode,
impl<'a, T> EncodeLike<Cow<'a, T>> for T
impl<T> EncodeLike<Rc<T>> for Twhere
T: Encode,
impl<S> FullCodec for Swhere
S: Decode + FullEncode,
impl<S> FullEncode for Swhere
S: Encode + EncodeLike,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
impl<T> MaybeDebug for Twhere
T: Debug,
impl<T> MaybeRefUnwindSafe for Twhere
T: RefUnwindSafe,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from.