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§
Source§impl Publish
impl Publish
pub fn new<S: Into<String>, P: Into<Vec<u8>>>( topic: S, qos: QoS, payload: P, ) -> Publish
pub fn from_bytes<S: Into<String>>( topic: S, qos: QoS, payload: Bytes, ) -> Publish
pub fn size(&self) -> usize
pub fn read(fixed_header: FixedHeader, bytes: Bytes) -> Result<Self, Error>
pub fn write(&self, buffer: &mut BytesMut) -> Result<usize, Error>
Trait Implementations§
impl Eq for Publish
impl StructuralPartialEq for Publish
Auto Trait Implementations§
impl !Freeze for Publish
impl RefUnwindSafe for Publish
impl Send for Publish
impl Sync for Publish
impl Unpin for Publish
impl UnwindSafe for Publish
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