pub struct Data { /* private fields */ }Expand description
Server-sent events data message containing a data field and optional id and event fields.
Implementations§
Source§impl Data
impl Data
Sourcepub fn new<T: Into<ByteString>>(data: T) -> Self
pub fn new<T: Into<ByteString>>(data: T) -> Self
Constructs a new SSE data message with just the data field.
§Examples
let event = actix_sse::Event::Data(actix_sse::Data::new("foo"));Sourcepub fn id(self, id: impl Into<ByteString>) -> Self
pub fn id(self, id: impl Into<ByteString>) -> Self
Sets id field, returning a new data message.
Sourcepub fn event(self, event: impl Into<ByteString>) -> Self
pub fn event(self, event: impl Into<ByteString>) -> Self
Sets event name field, returning a new data message.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Data
impl RefUnwindSafe for Data
impl Send for Data
impl Sync for Data
impl Unpin for Data
impl UnsafeUnpin for Data
impl UnwindSafe for Data
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