Struct minidump::format::GUID

source ·
pub struct GUID {
    pub data1: u32,
    pub data2: u16,
    pub data3: u16,
    pub data4: [u8; 8],
}
Expand description

A GUID as specified in Rpcdce.h

Matches the Microsoft struct of the same name.

§Display

There are two Display implementations for GUIDs. The regular formatting is lowercase with hyphens. The alternate formatting used with # is the symbol server format (uppercase without hyphens).

use minidump_common::format::GUID;

let guid = GUID { data1: 10, data2: 11, data3: 12, data4: [1,2,3,4,5,6,7,8] };

// default formatting
assert_eq!("0000000a-000b-000c-0102-030405060708", guid.to_string());

// symbol server formatting
assert_eq!("0000000A000B000C0102030405060708", format!("{:#}", guid));

Fields§

§data1: u32§data2: u16§data3: u16§data4: [u8; 8]

Trait Implementations§

source§

impl Clone for GUID

source§

fn clone(&self) -> GUID

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 GUID

source§

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

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

impl Display for GUID

source§

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

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

impl From<[u8; 16]> for GUID

Creates a GUID from a raw byte array. It is assumed that the components in the array are in big-endian order.

use minidump_common::format::GUID;

let mut buf = [0u8; 16];
buf[0..4].copy_from_slice(&0xdeadc0deu32.to_be_bytes());
buf[4..6].copy_from_slice(&0xb105u16.to_be_bytes());
buf[6..8].copy_from_slice(&0xc0deu16.to_be_bytes());
buf[8..].copy_from_slice(&[1, 2, 3, 4, 5, 6, 7, 8]);

let guid: GUID = buf.into();

let expected = GUID { data1: 0xdeadc0de, data2: 0xb105, data3: 0xc0de, data4: [1, 2, 3, 4, 5, 6, 7, 8] };

assert_eq!(guid, expected);
source§

fn from(uuid: [u8; 16]) -> GUID

Converts to this type from the input type.
source§

impl PartialEq for GUID

source§

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

source§

impl<'a> TryFromCtx<'a, Endian> for GUID
where GUID: 'a,

§

type Error = Error

source§

fn try_from_ctx( src: &'a [u8], ctx: Endian ) -> Result<(GUID, usize), <GUID as TryFromCtx<'a, Endian>>::Error>

source§

impl<'a> TryIntoCtx<Endian> for &'a GUID

§

type Error = Error

source§

fn try_into_ctx( self, dst: &mut [u8], ctx: Endian ) -> Result<usize, <&'a GUID as TryIntoCtx<Endian>>::Error>

source§

impl TryIntoCtx<Endian> for GUID

§

type Error = Error

source§

fn try_into_ctx( self, dst: &mut [u8], ctx: Endian ) -> Result<usize, <GUID as TryIntoCtx<Endian>>::Error>

source§

impl Copy for GUID

source§

impl Eq for GUID

source§

impl StructuralPartialEq for GUID

Auto Trait Implementations§

§

impl RefUnwindSafe for GUID

§

impl Send for GUID

§

impl Sync for GUID

§

impl Unpin for GUID

§

impl UnwindSafe for GUID

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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,

§

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more