Struct rustbus::wire::marshal::traits::SignatureBuffer[][src]

pub struct SignatureBuffer(_);
Expand description

SignatureBuffer is used to store static or dynamic signatures and avoid allocations if possible. It is a wrapper around Cow.

Implementations

Pushes a &str into the signature buffer.

Avoids an allocation if the self was empty and was not allocated already, by storing the &'static str inside a Cow::Borrowed variant.

Pushes a &str into the signature buffer.

If sig has a 'static lifetime then SignatureBuffer::push_static should almost always be used instead of this, because it can provide a performance benefit by avoiding allocation.

Return a &mut String which can be used to modify the signature.

Internally this is just a call to Cow::to_mut.

Clear the signature.

If an allocation was already made it is retained for future use. If you wish to deallocate when clearing, then simply use SignatureBuffer::new.

Trait Implementations

Performs the conversion.

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

The resulting type after dereferencing.

Dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.