pub struct Event { /* private fields */ }
Implementations§
Source§impl Event
impl Event
pub fn new( id: String, entity_id: String, topic: String, payload: Vec<u8>, timestamp: DateTime<Utc>, ) -> Result<Event, Error>
pub fn create<I, T, P>( entity_id: I, topic: T, payload: &P, ) -> Result<Event, Error>
pub fn id(&self) -> &str
pub fn entity_id(&self) -> &str
pub fn topic(&self) -> &str
pub fn payload(&self) -> &[u8] ⓘ
pub fn deserialize_payload<'a, T>(&'a self) -> Result<T, Error>where
T: Deserialize<'a>,
pub fn timestamp(&self) -> &DateTime<Utc>
Trait Implementations§
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
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