Struct mqttbytes::v4::Publish [−][src]
pub struct Publish { pub dup: bool, pub qos: QoS, pub retain: bool, pub topic: String, pub pkid: u16, pub payload: Bytes, }
Expand description
Publish packet
Fields
dup: bool
qos: QoS
retain: bool
topic: String
pkid: u16
payload: Bytes
Implementations
impl Publish
[src]
impl Publish
[src]pub fn new<S: Into<String>, P: Into<Vec<u8>>>(
topic: S,
qos: QoS,
payload: P
) -> Publish
[src]
topic: S,
qos: QoS,
payload: P
) -> Publish
pub fn from_bytes<S: Into<String>>(
topic: S,
qos: QoS,
payload: Bytes
) -> Publish
[src]
topic: S,
qos: QoS,
payload: Bytes
) -> Publish
pub fn read(fixed_header: FixedHeader, bytes: Bytes) -> Result<Self, Error>
[src]
pub fn write(&self, buffer: &mut BytesMut) -> Result<usize, Error>
[src]
Trait Implementations
impl StructuralPartialEq for Publish
[src]
Auto Trait Implementations
impl RefUnwindSafe for Publish
impl Send for Publish
impl Sync for Publish
impl Unpin for Publish
impl UnwindSafe for Publish
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more