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

pub struct SignatureBuffer(_);

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

Implementations

impl SignatureBuffer[src]

pub fn new() -> Self[src]

pub fn push_static(&mut self, sig: &'static str)[src]

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.

pub fn push_str(&mut self, sig: &str)[src]

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.

pub fn to_string_mut(&mut self) -> &mut String[src]

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

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

pub fn clear(&mut self)[src]

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.

pub fn from_string(sig: String) -> Self[src]

pub fn as_str(&self) -> &str[src]

Trait Implementations

impl AsRef<str> for SignatureBuffer[src]

impl Debug for SignatureBuffer[src]

impl Default for SignatureBuffer[src]

impl Deref for SignatureBuffer[src]

type Target = str

The resulting type after dereferencing.

Auto Trait Implementations

impl RefUnwindSafe for SignatureBuffer

impl Send for SignatureBuffer

impl Sync for SignatureBuffer

impl Unpin for SignatureBuffer

impl UnwindSafe for SignatureBuffer

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.