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
Auto Trait Implementations
impl RefUnwindSafe for SignatureBuffer
impl Send for SignatureBuffer
impl Sync for SignatureBuffer
impl Unpin for SignatureBuffer
impl UnwindSafe for SignatureBuffer