pub struct CloudEvent<T = ()> { /* private fields */ }
Expand description
Cloud event. See the spec.
Implementations§
Source§impl<T: Default> CloudEvent<T>
impl<T: Default> CloudEvent<T>
Source§impl<T> CloudEvent<T>
impl<T> CloudEvent<T>
Sourcepub fn set_subject(&mut self, subject: impl Into<SharedString>)
pub fn set_subject(&mut self, subject: impl Into<SharedString>)
Sets the subject.
Sourcepub fn set_session_id(&mut self, session_id: impl ToString)
pub fn set_session_id(&mut self, session_id: impl ToString)
Sets the session ID.
Sourcepub fn event_type(&self) -> &str
pub fn event_type(&self) -> &str
Returns the event type as a str
.
Sourcepub fn session_id(&self) -> Option<&str>
pub fn session_id(&self) -> Option<&str>
Returns a reference to the optional session ID.
Sourcepub fn stringify_data(&self) -> String
pub fn stringify_data(&self) -> String
Stringifies the event data as String
.
Trait Implementations§
Source§impl<T: Clone> Clone for CloudEvent<T>
impl<T: Clone> Clone for CloudEvent<T>
Source§fn clone(&self) -> CloudEvent<T>
fn clone(&self) -> CloudEvent<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for CloudEvent<T>
impl<T: Debug> Debug for CloudEvent<T>
Source§impl<T: Default> Default for CloudEvent<T>
impl<T: Default> Default for CloudEvent<T>
Source§fn default() -> CloudEvent<T>
fn default() -> CloudEvent<T>
Returns the “default value” for a type. Read more
Source§impl<'de, T> Deserialize<'de> for CloudEvent<T>
impl<'de, T> Deserialize<'de> for CloudEvent<T>
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
Auto Trait Implementations§
impl<T> Freeze for CloudEvent<T>where
T: Freeze,
impl<T> RefUnwindSafe for CloudEvent<T>where
T: RefUnwindSafe,
impl<T> Send for CloudEvent<T>where
T: Send,
impl<T> Sync for CloudEvent<T>where
T: Sync,
impl<T> Unpin for CloudEvent<T>where
T: Unpin,
impl<T> UnwindSafe for CloudEvent<T>where
T: 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