pub struct EventSet { /* private fields */ }Expand description
A set of event codes, as the events fmtp parameter lists them (section 2.4).
Bounded by construction: one bit per code 0 to 255. EventSet::default is the set a sender
assumes when the receiver sent no events parameter: DTMF 0 to 15 (section 2.5.1.1).
Implementations§
Source§impl EventSet
impl EventSet
Sourcepub fn parse(list: &str) -> Result<Self>
pub fn parse(list: &str) -> Result<Self>
Parses an events list such as 0-15,32,36 (section 2.4): comma-separated codes or
low-high ranges, unsorted, no white space.
§Errors
Fails on an empty list or element, white space, a non-decimal token, a code above 255 or a range whose upper bound is below its lower bound.
Sourcepub fn from_peer_fmtp(list: Option<&str>) -> Result<Self>
pub fn from_peer_fmtp(list: Option<&str>) -> Result<Self>
The set a sender may use towards a receiver: the receiver’s events list when it sent
one, otherwise DTMF 0 to 15 (section 2.5.1.1).
§Errors
Fails when the list is present and malformed (see EventSet::parse).
Sourcepub fn insert_range(&mut self, low: u8, high: u8)
pub fn insert_range(&mut self, low: u8, high: u8)
Adds every code from low to high inclusive.