[][src]Struct gelf::WireMessage

pub struct WireMessage<'a> { /* fields omitted */ }

WireMessage is the representation of a fully assembled GELF message

A fully assembled requires information only present in the Logger: Both the local hostname and possible missing metadata fields need to be added to the message.

A WireMessage can be serialized to GELF/JSON (with and without compression) and is the abstraction passed to the transportation backends.

Methods

impl<'a> WireMessage<'a>[src]

pub fn new(msg: Message<'a>, logger: &'a Logger) -> Self[src]

Construct a new wire message

The logger is required for populating the host-field and metadata fields which were not added to the message.

pub fn to_gelf(&self) -> Result<String>[src]

Return a GELF/JSON string of this message

pub fn to_compressed_gelf(
    &self,
    compression: MessageCompression
) -> Result<Vec<u8>>
[src]

Return a compressed GELF/JSON string of this message

pub fn to_chunked_message(
    &self,
    chunk_size: ChunkSize,
    compression: MessageCompression
) -> Result<ChunkedMessage>
[src]

Serialize the messages and prepare it for chunking

Trait Implementations

impl<'a> Serialize for WireMessage<'a>[src]

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
    S: Serializer
[src]

Serialize the message to a GELF/JSON string

Auto Trait Implementations

impl<'a> RefUnwindSafe for WireMessage<'a>

impl<'a> Send for WireMessage<'a>

impl<'a> Sync for WireMessage<'a>

impl<'a> Unpin for WireMessage<'a>

impl<'a> UnwindSafe for WireMessage<'a>

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,