[][src]Trait gvariant::SerializeTo

pub trait SerializeTo<T: Cast + ?Sized> {
    fn serialize(self, f: &mut impl Write) -> Result<usize>;
}

Trait to enable Serialization to GVariant

T in this instance is the type to be serialised to. For example: for GVariant type "ai" this will be [i32]. This means that there is a different SerializeTo trait for every GVariant type, and any rust type may implement serialization to any GVariant type. For example &[u8] can be serialized as a GVariant string "s" with SerializeTo<Str> or as a byte array with SerializeTo<[u8]>.

SerializeTo<> is implemented for appropriate built-in types, and you may wish to implement it for your own types as well.

Required methods

fn serialize(self, f: &mut impl Write) -> Result<usize>

Loading content...

Implementations on Foreign Types

impl SerializeTo<u8> for u8[src]

impl<'_> SerializeTo<u8> for &'_ u8[src]

impl SerializeTo<u16> for u16[src]

impl<'_> SerializeTo<u16> for &'_ u16[src]

impl SerializeTo<i16> for i16[src]

impl<'_> SerializeTo<i16> for &'_ i16[src]

impl SerializeTo<u32> for u32[src]

impl<'_> SerializeTo<u32> for &'_ u32[src]

impl SerializeTo<i32> for i32[src]

impl<'_> SerializeTo<i32> for &'_ i32[src]

impl SerializeTo<u64> for u64[src]

impl<'_> SerializeTo<u64> for &'_ u64[src]

impl SerializeTo<i64> for i64[src]

impl<'_> SerializeTo<i64> for &'_ i64[src]

impl SerializeTo<f64> for f64[src]

impl<'_> SerializeTo<f64> for &'_ f64[src]

impl<'_> SerializeTo<Str> for &'_ str[src]

impl<T: SerializeTo<Str> + Copy, '_> SerializeTo<Str> for &'_ T[src]

impl<'_> SerializeTo<Str> for &'_ Box<Str>[src]

impl<'_> SerializeTo<Str> for &'_ String[src]

impl<GvT: Cast, T: SerializeTo<GvT> + Copy, '_> SerializeTo<MaybeFixedSize<GvT>> for &'_ Option<T> where
    T: SerializeTo<GvT>, 
[src]

impl<'_> SerializeTo<Bool> for &'_ bool[src]

Loading content...

Implementors

impl<'_> SerializeTo<Bool> for &'_ Bool[src]

impl<'_> SerializeTo<Str> for &'_ Str[src]

impl<'_> SerializeTo<Variant> for &'_ Variant[src]

impl<'a, GvT: Cast + SerializeTo<GvT>> SerializeTo<MaybeFixedSize<GvT>> for &'a MaybeFixedSize<GvT> where
    &'a GvT: SerializeTo<GvT>, 
[src]

impl<GvT: Cast + Copy, It: IntoIterator> SerializeTo<[GvT]> for It where
    It::Item: SerializeTo<GvT>, 
[src]

impl<GvT: Cast + ?Sized, It: IntoIterator> SerializeTo<NonFixedWidthArray<GvT>> for It where
    It::Item: SerializeTo<GvT>, 
[src]

impl<GvT: Cast + ?Sized, T: IntoIterator> SerializeTo<MaybeNonFixedSize<GvT>> for T where
    T::Item: SerializeTo<GvT>, 
[src]

impl<M: Marker, T: SerializeTo<M::Type>> SerializeTo<Variant> for VariantWrap<M, T>[src]

Loading content...