[][src]Struct sailfish::runtime::Buffer

pub struct Buffer { /* fields omitted */ }

Buffer for rendered contents

This struct is quite simular to String, but some methods are re-implemented for faster buffering.

Implementations

impl Buffer[src]

pub const fn new() -> Buffer[src]

pub fn with_capacity(n: usize) -> Buffer[src]

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

pub fn len(&self) -> usize[src]

pub fn capacity(&self) -> usize[src]

pub unsafe fn set_len(&mut self, new_len: usize)[src]

Force the length of buffer to new_len

Safety

  • new_len must be less than or equal to capacity()
  • The elements at old_len..new_len must be initialized

pub fn is_empty(&self) -> bool[src]

pub fn reserve(&mut self, size: usize)[src]

pub fn clear(&mut self)[src]

pub fn into_string(self) -> String[src]

pub fn write_str(&mut self, data: &str)[src]

pub fn write_char(&mut self, data: char)[src]

Trait Implementations

impl<'_> Add<&'_ str> for Buffer[src]

type Output = Buffer

The resulting type after applying the + operator.

impl<'_> AddAssign<&'_ str> for Buffer[src]

impl Clone for Buffer[src]

impl Debug for Buffer[src]

impl Default for Buffer[src]

impl Drop for Buffer[src]

impl<'_> From<&'_ str> for Buffer[src]

impl From<String> for Buffer[src]

impl Write for Buffer[src]

Auto Trait Implementations

impl RefUnwindSafe for Buffer

impl !Send for Buffer

impl !Sync for Buffer

impl Unpin for Buffer

impl UnwindSafe for Buffer

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.