pub enum Event {
Message(String),
Custom(String, String),
}Variants§
Message(String)
Message(data)
Custom(String, String)
Custom(event_type, data)
Use Event::custom to make this variant.
Implementations§
source§impl Event
impl Event
sourcepub fn custom(event_type: impl AsRef<str>, data: String) -> Result<Self, String>
pub fn custom(event_type: impl AsRef<str>, data: String) -> Result<Self, String>
Errors
Returns an error when event contains newlines.
sourcepub fn write_to(&self, buf: &mut [u8]) -> Result<usize, Error>
pub fn write_to(&self, buf: &mut [u8]) -> Result<usize, Error>
Errors
Returns ErrorKind::WriteZero when buf is not big enough to hold the event data.
pub fn push_to(&self, buf: &mut Vec<u8>)
Trait Implementations§
source§impl Ord for Event
impl Ord for Event
source§impl PartialEq for Event
impl PartialEq for Event
source§impl PartialOrd for Event
impl PartialOrd for Event
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moreimpl Eq for Event
impl StructuralEq for Event
impl StructuralPartialEq for Event
Auto Trait Implementations§
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