Skip to main content

Format

Enum Format 

Source
#[repr(u8)]
pub enum Format {
Show 14 variants CLF = 0, JSON = 1, CEF = 2, ELF = 3, W3C = 4, GELF = 5, ApacheAccessLog = 6, Logstash = 7, Log4jXML = 8, NDJSON = 9, MCP = 10, OTLP = 11, Logfmt = 12, ECS = 13,
}
Expand description

Which of the 14 output formats a Record is written in.

The variants and their order mirror rlg::LogFormat, which stays in rlg because its parsing and validation need std. The discriminant indexes the writer table in crate::record, so the order is load-bearing.

Variants§

§

CLF = 0

Common Log Format (CLF)

§

JSON = 1

JavaScript Object Notation (JSON)

§

CEF = 2

Common Event Format (CEF)

§

ELF = 3

Extended Log Format (ELF)

§

W3C = 4

W3C Extended Log Format (W3C)

§

GELF = 5

Graylog Extended Log Format (GELF)

§

ApacheAccessLog = 6

Apache Access Log Format

§

Logstash = 7

Logstash Format

§

Log4jXML = 8

Log4j XML Format

§

NDJSON = 9

Network Data JSON (NDJSON)

§

MCP = 10

Model Context Protocol (MCP) - AI Native

§

OTLP = 11

OpenTelemetry Logging (OTLP) - AI Native

§

Logfmt = 12

Logfmt (key=value)

§

ECS = 13

Elastic Common Schema (ECS)

Implementations§

Source§

impl Format

Source

pub const ALL: [Self; 14]

Every format, in declaration order.

Source

pub const fn index(self) -> usize

The position of this format in Format::ALL.

Trait Implementations§

Source§

impl Clone for Format

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Format

Source§

impl Debug for Format

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Format

Source§

impl Hash for Format

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Format

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Format

Auto Trait Implementations§

§

impl Forget for Format

§

impl Freeze for Format

§

impl Move for Format

§

impl RefUnwindSafe for Format

§

impl Send for Format

§

impl Sync for Format

§

impl Unpin for Format

§

impl UnsafeUnpin for Format

§

impl UnwindSafe for Format

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.