pub struct Message {
    pub code: &'static str,
    pub label: &'static str,
    pub fixed_fields: &'static [&'static FixedField],
}
Expand description

SIP message definition with 2-character code, label, and fixed fields.

No attempt is made to specify which spec::Field’s are used for each Message since use in the wild varies wildly.

Fields

code: &'static str

Two-Character SIP Message Code

label: &'static str

For documentation and debugging purposes.

This value does not appear in any messages.

fixed_fields: &'static [&'static FixedField]

Fixed fields used by this message, defined in the order they appear in the compiled message.

Implementations

Maps a message code to a message spec.

use sip2::spec;
let msg = &spec::M_LOGIN;
let msg2 = spec::Message::from_code(&spec::M_LOGIN.code).unwrap();
assert_eq!(msg2.code, msg.code);

Trait Implementations

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.