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 PartialOrd for Event
impl PartialOrd for Event
impl Eq for Event
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