pub struct FrameBuilder { /* private fields */ }Expand description
Frame 构建器
Implementations§
Source§impl FrameBuilder
impl FrameBuilder
Sourcepub fn with_command(self, command: Command) -> Self
pub fn with_command(self, command: Command) -> Self
设置命令
Sourcepub fn with_message_id(self, message_id: String) -> Self
pub fn with_message_id(self, message_id: String) -> Self
设置消息 ID(不设置则自动生成)
Sourcepub fn with_reliability(self, reliability: Reliability) -> Self
pub fn with_reliability(self, reliability: Reliability) -> Self
设置可靠性等级
Sourcepub fn with_timestamp(self, timestamp: u64) -> Self
pub fn with_timestamp(self, timestamp: u64) -> Self
设置时间戳(不设置则使用当前时间)
Sourcepub fn with_metadata(self, key: String, value: Vec<u8>) -> Self
pub fn with_metadata(self, key: String, value: Vec<u8>) -> Self
添加元数据
Sourcepub fn with_metadata_str(self, key: String, value: String) -> Self
pub fn with_metadata_str(self, key: String, value: String) -> Self
添加字符串元数据
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FrameBuilder
impl RefUnwindSafe for FrameBuilder
impl Send for FrameBuilder
impl Sync for FrameBuilder
impl Unpin for FrameBuilder
impl UnsafeUnpin for FrameBuilder
impl UnwindSafe for FrameBuilder
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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