Struct tracelogging::OutType

source ·
#[repr(C)]
pub struct OutType(_);
Expand description

Data formatting hint that may be used or ignored by decoders.

Each field of an event has an InType (specifies the field’s binary encoding) and an OutType (formatting hint for the decoder).

If a field has an OutType set and the decoder supports the field’s combination of InType + OutType then the decoder will use the OutType as a formatting hint when decoding the field.

For example, a field with InType::U8 and OutType::Default is formatted as decimal. If the field sets OutType::Hex and the decoder supports U8+Hex then the field would be formatted as hexadecimal. If the field sets OutType::String and the decoder supports U8+String then it would be formatted as a CP1252 CHAR.

If the OutType is OutType::Default or is not supported by the decoder then the field receives a default formatting based on the field’s InType.

Note: Setting the OutType to a value other than Default will add 1 byte per field per event in the resulting ETL file. Add a non-Default OutType only if OutType::Default does not produce the desired format.

Implementations§

source§

impl OutType

source

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

Returns an OutType with the specified value. Requires: value <= 127.

source

pub const fn as_int(self) -> u8

Returns the numeric value corresponding to this OutType.

source

pub const Default: OutType = _

TlgOutNULL = default formatting will be applied based on the field’s InType.

source

pub const NoPrint: OutType = _

TlgOutNOPRINT = field should be hidden. (Most decoders show it anyway.)

source

pub const String: OutType = _

TlgOutSTRING = field should be formatted as a string. Use with InType::I8, InType::U8, or InType::U16 to log a char.

source

pub const Boolean: OutType = _

TlgOutBOOLEAN = field should be formatted as a Boolean. Use with InType::U8.

source

pub const Hex: OutType = _

TlgOutHEX = field should be formatted as hexadecimal. Use with InType::U8, InType::U16.

source

pub const Pid: OutType = _

TlgOutPID = field should be formatted as a process id. Use with InType::U32.

source

pub const Tid: OutType = _

TlgOutTID = field should be formatted as a thread id. Use with InType::U32.

source

pub const Port: OutType = _

TlgOutPORT = field should be formatted as a big-endian IP port. Use with InType::U16.

source

pub const IPv4: OutType = _

TlgOutIPV4 = field should be formatted as an IPv4 address. Use with InType::U32.

source

pub const IPv6: OutType = _

TlgOutIPV6 = field should be formatted as an IPv6 address. Use with InType::Binary or InType::BinaryC.

source

pub const SocketAddress: OutType = _

TlgOutSOCKETADDRESS = field should be formatted as a sockaddr. Use with InType::Binary or InType::BinaryC.

source

pub const Xml: OutType = _

TlgOutXML = field should be formatted as XML. Use with InType::Str16, InType::Str8, InType::CStr16, and InType::CStr8 types. Implies UTF-8 when used with InType::Str8 or InType::CStr8.

source

pub const Json: OutType = _

TlgOutJSON = field should be formatted as JSON. Use with InType::Str16, InType::Str8, InType::CStr16, and InType::CStr8 types. Implies UTF-8 when used with InType::Str8 or InType::CStr8.

source

pub const Win32Error: OutType = _

TlgOutWIN32ERROR = field should be formatted as a Win32 result code. Use with InType::U32.

source

pub const NtStatus: OutType = _

TlgOutNTSTATUS = field should be formatted as a Win32 NTSTATUS. Use with InType::U32.

source

pub const HResult: OutType = _

TlgOutHRESULT = field should be formatted as a Win32 HRESULT. Use with InType::I32.

source

pub const DateTime: OutType = _

TlgOutFILETIME = not generally used. Appropriate InTypes already imply DateTime.

source

pub const Signed: OutType = _

TlgOutSIGNED = not generally used. Appropriate InTypes already imply Signed.

source

pub const Unsigned: OutType = _

TlgOutUNSIGNED = not generally used. Appropriate InTypes already imply Unsigned.

source

pub const DateTimeCultureInsensitive: OutType = _

TlgOutDATETIME_CULTURE_INSENSITIVE = Invariant-culture date-time. Use with InType::FileTime or InType::SystemTime.

source

pub const Utf8: OutType = _

TlgOutUTF8 = field should be decoded as UTF-8. Use with InType::Str8 or InType::CStr8.

source

pub const Pkcs7WithTypeInfo: OutType = _

TlgOutPKCS7_WITH_TYPE_INFO = field should be decoded as a PKCS7 packet followed by TLG type info. Use with InType::Binary or InType::BinaryC.

source

pub const CodePointer: OutType = _

TlgOutCODE_POINTER = field should be formatted as a code pointer. Use with InType::U32, InType::U64, InType::USize, InType::Hex32, InType::Hex64, InType::HexSize.

source

pub const DateTimeUtc: OutType = _

TlgOutDATETIME_UTC = field should be decoded assuming UTC timezone. Use with InType::FileTime or InType::SystemTime.

source

pub const TypeMask: u8 = 127u8

_TlgOutTypeMask = raw encoding flag: mask for the outtype portion of the encoded byte.

Trait Implementations§

source§

impl Clone for OutType

source§

fn clone(&self) -> OutType

Returns a copy 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 OutType

source§

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

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

impl Default for OutType

source§

fn default() -> OutType

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

impl Display for OutType

source§

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

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

impl From<OutType> for u8

source§

fn from(val: OutType) -> Self

Converts to this type from the input type.
source§

impl From<u8> for OutType

source§

fn from(val: u8) -> Self

Converts to this type from the input type.
source§

impl Hash for OutType

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

source§

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

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

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

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

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

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

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

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

impl PartialEq<OutType> for OutType

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<OutType> for OutType

source§

fn partial_cmp(&self, other: &OutType) -> 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

This method 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

This method 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

This method 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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for OutType

source§

impl Eq for OutType

source§

impl StructuralEq for OutType

source§

impl StructuralPartialEq for OutType

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.