Struct tracelogging::InType

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

Advanced: Used to indicate the field’s type for raw metadata operations.

An InType indicates the binary encoding of the field, i.e. how to determine the field’s size. For example, InType::I32 indicates the field is always 4 bytes, while InType::Str8 indicates the field begins with a U16 byte-count to specify the field’s size. The InType also provides a default format to be used if a field’s OutType is OutType::Default, e.g. InType::I32 defaults to OutType::Signed, and InType::Hex32 defaults to OutType::Hex.

Implementations§

source§

impl InType

source

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

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

source

pub const fn as_int(self) -> u8

Returns the numeric value corresponding to this intype.

source

pub const Invalid: InType = _

TlgInNULL = Invalid type.

source

pub const CStr16: InType = _

TlgInUNICODESTRING = NUL-terminated UTF-16LE string.

Default format: OutType::String

Other usable formats: OutType::Xml, OutType::Json.

source

pub const CStr8: InType = _

TlgInANSISTRING = NUL-terminated 8-bit string, assumed to be encoded as CP1252.

Default format: OutType::String

Other usable formats: OutType::Xml, OutType::Json, OutType::Utf8.

source

pub const I8: InType = _

TlgInINT8 = 8-bit signed integer.

Default format: OutType::Signed

Other usable formats: OutType::String (formats as CP1252 char).

source

pub const U8: InType = _

TlgInUINT8 = 8-bit unsigned integer.

Default format: OutType::Unsigned

Other usable formats: OutType::Hex, OutType::String (formats as CP1252 char), OutType::Boolean.

source

pub const I16: InType = _

TlgInINT16 = 16-bit signed integer.

Default format: OutType::Signed

source

pub const U16: InType = _

TlgInUINT16 = 16-bit unsigned integer.

Default format: OutType::Unsigned

Other usable formats: OutType::Hex, OutType::String (formats as UCS-2 char), OutType::Port (formats as big-endian u16).

source

pub const I32: InType = _

TlgInINT32 = 32-bit signed integer.

Default format: OutType::Signed

Other usable formats: OutType::HResult.

source

pub const U32: InType = _

TlgInUINT32 = 32-bit unsigned integer.

Default format: OutType::Unsigned

Other usable formats: OutType::Pid, OutType::Tid, OutType::IPv4, OutType::Win32Error, OutType::NtStatus, OutType::CodePointer.

source

pub const I64: InType = _

TlgInINT64 = 64-bit signed integer.

Default format: OutType::Signed

source

pub const U64: InType = _

TlgInUINT64 = 64-bit signed integer.

Default format: OutType::Unsigned

Other usable formats: OutType::CodePointer.

source

pub const F32: InType = _

TlgInFLOAT = 32-bit float.

source

pub const F64: InType = _

TlgInDOUBLE = 64-bit float.

source

pub const Bool32: InType = _

TlgInBOOL32 = 32-bit Boolean.

Default format: OutType::Boolean

source

pub const Binary: InType = _

TlgInBINARY = UINT16 byte-count followed by binary data.

Default format: OutType::Hex

Other usable formats: OutType::IPv6, OutType::SocketAddress, OutType::Pkcs7WithTypeInfo.

Note: Array of Binary is not supported. For arrays, use InType::BinaryC.

source

pub const Guid: InType = _

TlgInGUID = 128-bit GUID in Windows (little-endian) byte order.

source

pub const _HexSize_PlatformSpecific: InType = _

_TlgInPOINTER_unsupported = Not supported. Use InType::HexSize instead.

source

pub const FileTime: InType = _

TlgInFILETIME = 64-bit timestamp in Windows FILETIME format.

Default format: OutType::DateTime

Other usable formats: OutType::DateTimeCultureInsensitive, OutType::DateTimeUtc.

source

pub const SystemTime: InType = _

TlgInSYSTEMTIME = 128-bit date/time in Windows SYSTEMTIME format.

Default format: OutType::DateTime

Other usable formats: OutType::DateTimeCultureInsensitive, OutType::DateTimeUtc.

source

pub const Sid: InType = _

TlgInSID = Security ID in Windows SID format.

Note: Expected size of value is GetSidLength(sid_bytes) = sid_bytes[1] * 4 + 8.

source

pub const Hex32: InType = _

TlgInHEXINT32 = 32-bit integer formatted as hex.

Default format: OutType::Hex

Other usable formats: OutType::Win32Error, OutType::NtStatus, OutType::CodePointer.

source

pub const Hex64: InType = _

TlgInHEXINT64 = 64-bit integer formatted as hex.

Default format: OutType::Hex

Other usable formats: OutType::CodePointer.

source

pub const Str16: InType = _

TlgInCOUNTEDSTRING = 16-bit byte count followed by UTF-16LE string.

Default format: OutType::String

Other usable formats: OutType::Xml, OutType::Json.

source

pub const Str8: InType = _

TlgInCOUNTEDANSISTRING = 16-bit byte count followed by 8-bit string, assumed to be encoded as CP1252.

Default format: OutType::String

Other usable formats: OutType::Xml, OutType::Json, OutType::Utf8.

source

pub const Struct: InType = _

_TlgInSTRUCT = The struct field contains no data, but the following N fields will be considered as logically part of the struct field, where N is a value from 1 to 127 encoded into the OutType slot.

source

pub const BinaryC: InType = _

TlgInCOUNTEDBINARY = UINT16 byte-count followed by binary data.

Default format: OutType::Hex

Other usable formats: OutType::IPv6, OutType::SocketAddress, OutType::Pkcs7WithTypeInfo.

This is the same as InType::Binary except:

  • New type code. Decoders might not support it yet.
  • Decodes without the synthesized “FieldName.Length” fields that are common with Binary.
  • Arrays are supported.
source

pub const ISize: InType = _

TlgInINTPTR = an alias for either InType::I64 or InType::I32, depending on the running process’s pointer size.

Default format: OutType::Signed

source

pub const USize: InType = _

TlgInUINTPTR = an alias for either InType::U64 or InType::U32, depending on the running process’s pointer size.

Default format: OutType::Unsigned

Other usable formats: OutType::CodePointer.

source

pub const HexSize: InType = _

TlgInPOINTER = an alias for either InType::Hex64 or InType::Hex32, depending on the running process’s pointer size.

Default format: OutType::Hex

Other usable formats: OutType::CodePointer.

source

pub const ConstantCountFlag: u8 = 32u8

Raw encoding flag: _TlgInCcount indicates that field metadata contains a const-array-count slot.

source

pub const VariableCountFlag: u8 = 64u8

Raw encoding flag: TlgInVcount indicates that field data contains a variable-array-count slot.

source

pub const CustomFlag: u8 = 96u8

Raw encoding flag: _TlgInCustom indicates that the field uses a custom serializer.

source

pub const TypeMask: u8 = 31u8

Raw encoding flag: _TlgInTypeMask is a mask for the intype portion of the encoded byte.

source

pub const FlagMask: u8 = 96u8

Raw encoding flag: _TlgInFlagMask is a mask for the flags portion of the encoded byte.

Trait Implementations§

source§

impl Clone for InType

source§

fn clone(&self) -> InType

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 InType

source§

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

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

impl Default for InType

source§

fn default() -> InType

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

impl Display for InType

source§

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

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

impl From<InType> for u8

source§

fn from(val: InType) -> Self

Converts to this type from the input type.
source§

impl From<u8> for InType

source§

fn from(val: u8) -> Self

Converts to this type from the input type.
source§

impl Hash for InType

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 InType

source§

fn cmp(&self, other: &InType) -> 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<InType> for InType

source§

fn eq(&self, other: &InType) -> 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<InType> for InType

source§

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

source§

impl Eq for InType

source§

impl StructuralEq for InType

source§

impl StructuralPartialEq for InType

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.