[−][src]Struct gelf::WireMessage
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]
&self,
compression: MessageCompression
) -> Result<Vec<u8>>
Return a compressed GELF/JSON string of this message
pub fn to_chunked_message(
&self,
chunk_size: ChunkSize,
compression: MessageCompression
) -> Result<ChunkedMessage>
[src]
&self,
chunk_size: ChunkSize,
compression: MessageCompression
) -> Result<ChunkedMessage>
Serialize the messages and prepare it for chunking
Trait Implementations
impl<'a> Serialize for WireMessage<'a>
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,