pub struct EventPayloadDescriptor {
pub object_type: String,
pub payload_type: PayloadType,
pub units: Option<Unit>,
pub currency: Option<String>,
}Expand description
Context needed to interpret event payload values.
Fields§
§object_type: StringDiscriminator; always EVENT_PAYLOAD_DESCRIPTOR.
payload_type: PayloadTypeThe payload type this descriptor describes.
units: Option<Unit>Unit of measure.
currency: Option<String>ISO 4217 currency, for price payloads.
Implementations§
Source§impl EventPayloadDescriptor
impl EventPayloadDescriptor
Sourcepub fn new(payload_type: PayloadType) -> Self
pub fn new(payload_type: PayloadType) -> Self
A descriptor for a payload type.
Sourcepub fn with_units(self, units: Unit) -> Self
pub fn with_units(self, units: Unit) -> Self
Set the unit of measure.
Sourcepub fn with_currency(self, currency: impl Into<String>) -> Self
pub fn with_currency(self, currency: impl Into<String>) -> Self
Set the currency.
Trait Implementations§
Source§impl Clone for EventPayloadDescriptor
impl Clone for EventPayloadDescriptor
Source§impl Debug for EventPayloadDescriptor
impl Debug for EventPayloadDescriptor
Source§impl<'de> Deserialize<'de> for EventPayloadDescriptor
impl<'de> Deserialize<'de> for EventPayloadDescriptor
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<EventPayloadDescriptor> for PayloadDescriptor
impl From<EventPayloadDescriptor> for PayloadDescriptor
Source§fn from(descriptor: EventPayloadDescriptor) -> Self
fn from(descriptor: EventPayloadDescriptor) -> Self
Converts to this type from the input type.
Source§impl PartialEq for EventPayloadDescriptor
impl PartialEq for EventPayloadDescriptor
Source§impl Serialize for EventPayloadDescriptor
impl Serialize for EventPayloadDescriptor
impl StructuralPartialEq for EventPayloadDescriptor
Auto Trait Implementations§
impl Forget for EventPayloadDescriptor
impl Freeze for EventPayloadDescriptor
impl Move for EventPayloadDescriptor
impl RefUnwindSafe for EventPayloadDescriptor
impl Send for EventPayloadDescriptorwhere
RawVecInner: Send,
impl Sync for EventPayloadDescriptorwhere
RawVecInner: Sync,
impl Unpin for EventPayloadDescriptor
impl UnsafeUnpin for EventPayloadDescriptor
impl UnwindSafe for EventPayloadDescriptorwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more