[][src]Struct serde_stacker::Serializer

pub struct Serializer<S> {
    pub ser: S,
    pub red_zone: usize,
    pub stack_size: usize,
}

Serializer adapter that avoids stack overflows by dynamically growing the stack.

At each level of nested serialization, the adapter will check whether it is within red_zone bytes of the end of the stack. If so, it will allocate a new stack of size stack_size on which to continue deserialization.

Fields

ser: Sred_zone: usizestack_size: usize

Implementations

impl<S> Serializer<S>[src]

pub fn new(serializer: S) -> Self[src]

Build a serializer adapter with reasonable default red_zone (64 KB) and stack_size (2 MB).

Trait Implementations

impl<S> Serializer for Serializer<S> where
    S: Serializer
[src]

type Ok = S::Ok

The output type produced by this Serializer during successful serialization. Most serializers that produce text or binary output should set Ok = () and serialize into an [io::Write] or buffer contained within the Serializer instance. Serializers that build in-memory data structures may be simplified by using Ok to propagate the data structure around. Read more

type Error = S::Error

The error type when some error occurs during serialization.

type SerializeSeq = SerializeSeq<S::SerializeSeq>

Type returned from [serialize_seq] for serializing the content of the sequence. Read more

type SerializeTuple = SerializeTuple<S::SerializeTuple>

Type returned from [serialize_tuple] for serializing the content of the tuple. Read more

type SerializeTupleStruct = SerializeTupleStruct<S::SerializeTupleStruct>

Type returned from [serialize_tuple_struct] for serializing the content of the tuple struct. Read more

type SerializeTupleVariant = SerializeTupleVariant<S::SerializeTupleVariant>

Type returned from [serialize_tuple_variant] for serializing the content of the tuple variant. Read more

type SerializeMap = SerializeMap<S::SerializeMap>

Type returned from [serialize_map] for serializing the content of the map. Read more

type SerializeStruct = SerializeStruct<S::SerializeStruct>

Type returned from [serialize_struct] for serializing the content of the struct. Read more

type SerializeStructVariant = SerializeStructVariant<S::SerializeStructVariant>

Type returned from [serialize_struct_variant] for serializing the content of the struct variant. Read more

Auto Trait Implementations

impl<S> RefUnwindSafe for Serializer<S> where
    S: RefUnwindSafe

impl<S> Send for Serializer<S> where
    S: Send

impl<S> Sync for Serializer<S> where
    S: Sync

impl<S> Unpin for Serializer<S> where
    S: Unpin

impl<S> UnwindSafe for Serializer<S> where
    S: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.