#[non_exhaustive]pub struct CommonHighlight {
pub style: Style,
pub symbol: LineStatic,
}Expand description
Prop Store for very common highlight props.
This structure helps to have a common way to handle the “very common” highlight properties, reducing boilerplate and potential mis-matches.
Additionally, using this over Props, saves on indirection and heap-size.
On usage (usually on view), it also saves on unwraps or “defaulting”
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.style: StyleThe main style to patch CommonProps::style with for the currently active element.
symbol: LineStaticThe symbol to use to indicate the currently selected element.
Implementations§
Source§impl CommonHighlight
impl CommonHighlight
Sourcepub fn set(&mut self, attr: Attribute, value: AttrValue) -> Option<AttrValue>
pub fn set(&mut self, attr: Attribute, value: AttrValue) -> Option<AttrValue>
Try to set a given Attribute. Returns Some if the value is unhandled. None if handled.
Sourcepub fn get<'a>(&'a self, attr: Attribute) -> Option<AttrValueRef<'a>>
pub fn get<'a>(&'a self, attr: Attribute) -> Option<AttrValueRef<'a>>
Try to get a given Attribute.
Sourcepub fn get_for_query<'a>(&'a self, attr: Attribute) -> Option<QueryResult<'a>>
pub fn get_for_query<'a>(&'a self, attr: Attribute) -> Option<QueryResult<'a>>
Try to get a given Attribute as a type compatible with Component::query.
pub fn get_symbol(&self) -> Option<Line<'_>>
pub fn get_style(&self, normal_style: Style) -> Style
Trait Implementations§
Source§impl Clone for CommonHighlight
impl Clone for CommonHighlight
Source§fn clone(&self) -> CommonHighlight
fn clone(&self) -> CommonHighlight
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommonHighlight
impl Debug for CommonHighlight
Source§impl Default for CommonHighlight
impl Default for CommonHighlight
Source§impl PartialEq for CommonHighlight
impl PartialEq for CommonHighlight
impl Eq for CommonHighlight
impl StructuralPartialEq for CommonHighlight
Auto Trait Implementations§
impl Freeze for CommonHighlight
impl RefUnwindSafe for CommonHighlight
impl Send for CommonHighlight
impl Sync for CommonHighlight
impl Unpin for CommonHighlight
impl UnsafeUnpin for CommonHighlight
impl UnwindSafe for CommonHighlight
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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 moreSource§impl<T> PropBound for T
impl<T> PropBound for T
Source§fn to_any_prop(self) -> Box<dyn PropBound>
fn to_any_prop(self) -> Box<dyn PropBound>
Convert any
PropBound value to a AnyPropBox value.