Struct log_wrappers::test_util::SyncLoggerBuffer[][src]

pub struct SyncLoggerBuffer(Arc<Mutex<Vec<u8>>>);

A buffer which can be served as a logging destination while being able to access its content.

Implementations

impl SyncLoggerBuffer[src]

pub fn new() -> SyncLoggerBuffer

Notable traits for SyncLoggerBuffer

impl Write for SyncLoggerBuffer
[src]

Creates a new instance.

pub fn build_logger(&self) -> Logger[src]

Builds a slog::Logger over this buffer which uses compact format and always output TIME in the time field.

fn lock(&self) -> MutexGuard<'_, Vec<u8>>[src]

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

Clones the buffer and creates a String.

Panics if the buffer is not a valid UTF-8 string.

pub fn clear(&self)[src]

Clears the buffer.

Trait Implementations

impl Clone for SyncLoggerBuffer[src]

impl Default for SyncLoggerBuffer[src]

impl Write for SyncLoggerBuffer[src]

Auto Trait Implementations

impl RefUnwindSafe for SyncLoggerBuffer

impl Send for SyncLoggerBuffer

impl Sync for SyncLoggerBuffer

impl Unpin for SyncLoggerBuffer

impl UnwindSafe for SyncLoggerBuffer

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> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[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.

impl<W> WriteBytesExt for W where
    W: Write + ?Sized
[src]