FieldFormat

Struct FieldFormat 

Source
pub struct FieldFormat(/* private fields */);
Expand description

Values for the format byte of a field definition.

The low 7 bits of the format byte contain the field’s format. In the case of the Struct encoding, the low 7 bits of the format byte contain the number of logical fields in the struct (which must not be 0).

The top bit of the field format byte is the ChainFlag. If set, it indicates that a field tag (uint16) is present after the format byte. If not set, the field tag is not present and is assumed to be 0.

Implementations§

Source§

impl FieldFormat

Source

pub const Default: FieldFormat

Use the default format of the encoding.

Source

pub const UnsignedInt: FieldFormat

unsigned integer, event byte order. Use with Value8..Value64 encodings.

Source

pub const SignedInt: FieldFormat

signed integer, event byte order. Use with Value8..Value64 encodings.

Source

pub const HexInt: FieldFormat

hex integer, event byte order. Use with Value8..Value64 encodings.

Source

pub const Errno: FieldFormat

errno, event byte order. Use with Value32 encoding.

Source

pub const Pid: FieldFormat

process id, event byte order. Use with Value32 encoding.

Source

pub const Time: FieldFormat

signed integer, event byte order, seconds since 1970. Use with Value32 or Value64 encodings.

Source

pub const Boolean: FieldFormat

0 = false, 1 = true, event byte order. Use with Value8..Value32 encodings.

Source

pub const Float: FieldFormat

floating point, event byte order. Use with Value32..Value64 encodings.

Source

pub const HexBytes: FieldFormat

binary, decoded as hex dump of bytes. Use with any encoding.

Source

pub const String8: FieldFormat

8-bit char string, unspecified character set (usually treated as ISO-8859-1 or CP-1252). Use with Value8 and Char8 encodings.

Source

pub const StringUtf: FieldFormat

UTF string, event byte order, code unit size based on encoding. Use with Value16..Value32 and Char8..Char32 encodings.

Source

pub const StringUtfBom: FieldFormat

UTF string, BOM used if present, otherwise behaves like string_utf. Use with Char8..Char32 encodings.

Source

pub const StringXml: FieldFormat

XML string, otherwise behaves like string_utf_bom. Use with Char8..Char32 encodings.

Source

pub const StringJson: FieldFormat

JSON string, otherwise behaves like string_utf_bom. Use with Char8..Char32 encodings.

Source

pub const Uuid: FieldFormat

UUID, network byte order (RFC 4122 format). Use with Value128 encoding.

Source

pub const Port: FieldFormat

IP port, network byte order (in_port_t layout). Use with Value16 encoding.

Source

pub const IPAddress: FieldFormat

IP address, network byte order (in_addr/in6_addr layout). Use with Value32 or Value128 encoding.

Source

pub const IPAddressObsolete: FieldFormat

Do not produce this format. Decode the same as IPAddress.

Source

pub const IPv4: FieldFormat = Self::IPAddress

Deprecated alias for IPAddress.

Source

pub const IPv6: FieldFormat = Self::IPAddressObsolete

Deprecated alias for IPAddressObsolete.

Source

pub const ValueMask: u8 = 127u8

Mask for the type field.

Source

pub const ChainFlag: u8 = 128u8

A field tag (uint16) follows the format byte.

Source

pub const fn from_int(value: u8) -> FieldFormat

Returns a FieldFormat with the specified value.

Source

pub const fn as_int(self) -> u8

Returns the numeric value corresponding to this FieldFormat value.

Source

pub const fn without_flags(self) -> FieldFormat

Returns the encoding without any flags (format & ValueMask).

Source

pub const fn has_chain_flag(self) -> bool

Returns true if ChainFlag is present (tag present in event).

Trait Implementations§

Source§

impl Clone for FieldFormat

Source§

fn clone(&self) -> FieldFormat

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for FieldFormat

Source§

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

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

impl Default for FieldFormat

Source§

fn default() -> FieldFormat

Returns the “default value” for a type. Read more
Source§

impl Display for FieldFormat

Source§

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

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

impl From<u8> for FieldFormat

Source§

fn from(val: u8) -> FieldFormat

Converts to this type from the input type.
Source§

impl Hash for FieldFormat

Source§

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

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 Ord for FieldFormat

Source§

fn cmp(&self, other: &FieldFormat) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for FieldFormat

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for FieldFormat

Source§

fn partial_cmp(&self, other: &FieldFormat) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for FieldFormat

Source§

impl Eq for FieldFormat

Source§

impl StructuralPartialEq for FieldFormat

Auto Trait Implementations§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.