Trait ruci::MessageParameterPointer
source · pub trait MessageParameterPointer: Copy + Debug + Hash + Eq + PartialEq {
type MessagePointer: MessagePointer;
// Required methods
fn as_string(self) -> &'static str;
fn from_message_and_str(
message_pointer: Self::MessagePointer,
s: &str
) -> Result<Self, MessageParameterPointerParseError>;
fn has_value(self) -> bool;
}Expand description
This is a simple Copy “pointer” enum necessary for parsing.
Required Associated Types§
Required Methods§
fn as_string(self) -> &'static str
sourcefn from_message_and_str(
message_pointer: Self::MessagePointer,
s: &str
) -> Result<Self, MessageParameterPointerParseError>
fn from_message_and_str( message_pointer: Self::MessagePointer, s: &str ) -> Result<Self, MessageParameterPointerParseError>
Parses a string to a message parameter pointer.
§Errors
MessageParameterPointerParseError::MessageHasNoParameters: if themessage_pointerargument points to a message without parameters, such asuciok.MessageParameterPointerParseError::StringDoesNotMapToParameterPointer: if themessage_pointerargument points to a message, which does have parameters, but thesargument doesn’t match any of them. For example, if you pass in a message pointer for theidcommand, but thesargument is"developer", this will error becauseidonly hasnameandauthorparameters.
Object Safety§
This trait is not object safe.