pub struct SegmentStyles(/* private fields */);Expand description
A segment id -> style lookup for styling a single frame’s
SegmentMap. See SequenceStyles for styling a whole sequence of
frames, where the same segment id means different things frame to
frame.
Implementations§
Source§impl SegmentStyles
impl SegmentStyles
pub fn new() -> Self
pub fn set(self, id: usize, style: SegmentStyle) -> Self
Sourcepub fn set_named(
self,
map: &SegmentMap,
name: &str,
style: SegmentStyle,
) -> Self
pub fn set_named( self, map: &SegmentMap, name: &str, style: SegmentStyle, ) -> Self
Like SegmentStyles::set, but resolves name against map
first. Returns self unchanged (a no-op) if no segment has that
name, so this can still be chained fluently; check
SegmentMap::find_by_name yourself first if that should be an
error instead.
pub fn get(&self, id: usize) -> Option<&SegmentStyle>
Trait Implementations§
Source§impl Clone for SegmentStyles
impl Clone for SegmentStyles
Auto Trait Implementations§
impl !RefUnwindSafe for SegmentStyles
impl !UnwindSafe for SegmentStyles
impl Freeze for SegmentStyles
impl Send for SegmentStyles
impl Sync for SegmentStyles
impl Unpin for SegmentStyles
impl UnsafeUnpin for SegmentStyles
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more