pub struct Params<'a> { /* private fields */ }Expand description
Borrowed view of a CSI / DCS parameter body.
Implementations§
Source§impl<'a> Params<'a>
impl<'a> Params<'a>
Sourcepub fn from_raw(raw: &'a [u8]) -> Self
pub fn from_raw(raw: &'a [u8]) -> Self
Wrap the raw parameter bytes (between the introducer’s last byte and the final byte, exclusive on both ends).
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Number of ;-separated groups. An empty body has zero groups;
a trailing ; produces an extra empty group.
Sourcepub fn group(&self, idx: usize) -> Option<Group<'a>>
pub fn group(&self, idx: usize) -> Option<Group<'a>>
The n-th group, or None when idx >= len().
Sourcepub fn get(&self, idx: usize) -> Option<u32>
pub fn get(&self, idx: usize) -> Option<u32>
First sub-parameter of the n-th group. None for absent groups
and explicitly empty slots.
Sourcepub fn get_or(&self, idx: usize, default: u32) -> u32
pub fn get_or(&self, idx: usize, default: u32) -> u32
First sub-parameter of the n-th group, or default when the
group is absent or the slot is explicitly empty.
Sourcepub fn slice_from(&self, start: usize) -> Params<'a>
pub fn slice_from(&self, start: usize) -> Params<'a>
A Params view starting at the group at index start. Used
when a caller needs to expose “the rest of the parameter list”
(e.g. Event::WindowOp’s args).
Trait Implementations§
Source§impl<'a> IntoIterator for Params<'a>
impl<'a> IntoIterator for Params<'a>
impl<'a> Copy for Params<'a>
Auto Trait Implementations§
impl<'a> Freeze for Params<'a>
impl<'a> RefUnwindSafe for Params<'a>
impl<'a> Send for Params<'a>
impl<'a> Sync for Params<'a>
impl<'a> Unpin for Params<'a>
impl<'a> UnsafeUnpin for Params<'a>
impl<'a> UnwindSafe for Params<'a>
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