Struct lunatic_twitchax_patch::Tag
source · pub struct Tag(/* private fields */);Expand description
A i64 value used as a message tag.
Processes can selectively receive messages based on the message’s tag. This mechanism can be used to handle messages in a different order from their arrival.
Creating a new tag will return a process-unique value. Some tag values are reserved for internal use only, but the range from 64 to 128 can be used by the developer to assign application specific meaning.
Implementations§
source§impl Tag
impl Tag
sourcepub fn new() -> Tag
pub fn new() -> Tag
Returns a unique tag inside this process.
Two calls to Tag::new() are guaranteed to return a unique tag only if
they occurred inside the same process.
sourcepub fn none() -> Tag
pub fn none() -> Tag
Returns a special tag that is used by Process::send.
Most messages where the order is not significant use this tag.
sourcepub fn special(id: i64) -> Option<Tag>
pub fn special(id: i64) -> Option<Tag>
Create a special purpose tag.
The id must be in the range between 64 and 128 or the function will
return None.