#[non_exhaustive]pub struct Message { /* private fields */ }
Expand description
Event Stream message.
Implementations§
Source§impl Message
impl Message
Sourcepub fn new(payload: impl Into<Bytes>) -> Message
pub fn new(payload: impl Into<Bytes>) -> Message
Creates a new message with the given payload
. Headers can be added later.
Sourcepub fn new_from_parts(headers: Vec<Header>, payload: impl Into<Bytes>) -> Self
pub fn new_from_parts(headers: Vec<Header>, payload: impl Into<Bytes>) -> Self
Creates a message with the given headers
and payload
.
Sourcepub fn add_header(self, header: Header) -> Self
pub fn add_header(self, header: Header) -> Self
Adds a header to the message.
Trait Implementations§
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl !Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more