pub struct Topic(/* private fields */);Expand description
Tag type to route messagse to the right handler. Should be printable 0-terminated ASCII chars.
Implementations§
Source§impl Topic
impl Topic
Sourcepub fn new(buf: TopicInner) -> Self
pub fn new(buf: TopicInner) -> Self
Wraps a raw array topic.
pub const fn from_const_str(s: &'static str) -> Self
pub fn inner(&self) -> &TopicInner
pub fn into_inner(&self) -> TopicInner
Sourcepub fn as_str_bytes(&self) -> &[u8] ⓘ
pub fn as_str_bytes(&self) -> &[u8] ⓘ
Returns a slice of the string bytes of the topic.
Sourcepub fn is_standard(&self) -> bool
pub fn is_standard(&self) -> bool
Returns if it’s a standard topic ID.
Trait Implementations§
Source§impl BorshDeserialize for Topic
impl BorshDeserialize for Topic
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for Topic
impl BorshSerialize for Topic
Source§impl Ord for Topic
impl Ord for Topic
Source§impl PartialOrd for Topic
impl PartialOrd for Topic
impl Copy for Topic
impl Eq for Topic
impl StructuralPartialEq for Topic
Auto Trait Implementations§
impl Freeze for Topic
impl RefUnwindSafe for Topic
impl Send for Topic
impl Sync for Topic
impl Unpin for Topic
impl UnwindSafe for Topic
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