[−][src]Struct serde_gelf::GelfRecord
Structure which represent a log record.
Trait Implementations
impl GelfRecordBuilder for GelfRecord
[src]
fn new() -> GelfRecord
[src]
Construct new GelfRecord.
fn set_message(self, short_message: String) -> Self
[src]
Set GelfRecord.short_message
.
fn set_level(self, level: GelfLevel) -> Self
[src]
Set GelfRecord.level
.
fn set_timestamp(self, timestamp: f64) -> Self
[src]
Set GelfRecord.timestamp
.
Example
use serde_gelf::GelfRecord; use std::time::{SystemTime, UNIX_EPOCH}; let rec = GelfRecord::new() .set_timestamp({ let now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap(); now.as_secs() as f64 + f64::from(now.subsec_nanos()) / 1e9 });
fn add_additional_fields(
self,
additional_fields: BTreeMap<Value, Value>
) -> Self
[src]
self,
additional_fields: BTreeMap<Value, Value>
) -> Self
Extend a already flatten dict to GelfRecord.additional_fields
.
Example
use std::collections::BTreeMap; use serde_gelf::{GelfRecord, GelfLevel, to_flat_dict}; let mut extra = BTreeMap::new(); extra.insert("integer".into(), serde_value::Value::I8(10)); let rec = GelfRecord::new() .extend_additional_fields(to_flat_dict(&extra).unwrap());
fn extend_additional_fields(
self,
additional_fields: BTreeMap<Value, Value>
) -> Self
[src]
self,
additional_fields: BTreeMap<Value, Value>
) -> Self
Extend a already flatten dict to GelfRecord.additional_fields
.
Example
use std::collections::BTreeMap; use serde_gelf::{GelfRecord, GelfLevel, to_flat_dict}; let mut extra = BTreeMap::new(); extra.insert("integer".into(), serde_value::Value::I8(10)); let rec = GelfRecord::new() .extend_additional_fields(to_flat_dict(&extra).unwrap());
fn set_facility(self, facility: String) -> Self
[src]
Set GelfRecord.facility
.
fn set_line(self, line: u32) -> Self
[src]
Set GelfRecord.line
.
fn set_file(self, file: String) -> Self
[src]
Set GelfRecord.file
.
fn set_full_message(self, full_message: Option<String>) -> Self
[src]
Set GelfRecord.full_message
.
impl GelfRecordGetter for GelfRecord
[src]
fn message(&self) -> String
[src]
Return the GelfRecord.message
attribute.
fn timestamp(&self) -> f64
[src]
Return the GelfRecord.timestamp
attribute.
fn level(&self) -> GelfLevel
[src]
Return the GelfRecord.level
attribute.
fn additional_fields(&self) -> BTreeMap<Value, Value>
[src]
Return the GelfRecord.additional_fields
attribute.
fn facility(&self) -> String
[src]
Return the GelfRecord.facility
attribute.
fn line(&self) -> u32
[src]
Return the GelfRecord.line
attribute.
fn file(&self) -> String
[src]
Return the GelfRecord.file
attribute.
fn version() -> &'static str
[src]
Return the GelfRecord.version
attribute.
fn full_message(&self) -> Option<String>
[src]
Return the GelfRecord.full_message
attribute.
impl<'a, '_> From<&'_ Record<'a>> for GelfRecord
[src]
fn from(record: &Record) -> GelfRecord
[src]
impl<'_, R: GelfRecordGetter> From<&'_ R> for GelfRecord
[src]
fn from(record: &R) -> GelfRecord
[src]
impl Clone for GelfRecord
[src]
fn clone(&self) -> GelfRecord
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for GelfRecord
[src]
impl Serialize for GelfRecord
[src]
Auto Trait Implementations
impl Sync for GelfRecord
impl Send for GelfRecord
impl Unpin for GelfRecord
impl RefUnwindSafe for GelfRecord
impl UnwindSafe for GelfRecord
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,