pub struct Shapes { /* private fields */ }Expand description
The rules, in the order the caller gave them.
Empty is the ordinary state and means Shape::Auto for everything, which
is what every export did before there was anything to ask.
Implementations§
Source§impl Shapes
impl Shapes
Sourcepub fn with(self, selector: Selector, shape: Shape) -> Self
pub fn with(self, selector: Selector, shape: Shape) -> Self
Add a rule at the end, where it will be tried last.
Sourcepub fn parse_rule(self, rule: &str) -> Result<Self, String>
pub fn parse_rule(self, rule: &str) -> Result<Self, String>
Parse one PATTERN=SHAPE rule and add it.
The error says which half was not understood and what the alternatives
are, because this is typed on a command line by someone who will not go
looking for documentation to find out that polygon was spelled
polygons.
Sourcepub fn shape_for(&self, qualified_type: &str) -> Shape
pub fn shape_for(&self, qualified_type: &str) -> Shape
The shape asked for this qualified type: the first rule that matches, or
Shape::Auto.
Trait Implementations§
impl Eq for Shapes
impl StructuralPartialEq for Shapes
Auto Trait Implementations§
impl Freeze for Shapes
impl RefUnwindSafe for Shapes
impl Send for Shapes
impl Sync for Shapes
impl Unpin for Shapes
impl UnsafeUnpin for Shapes
impl UnwindSafe for Shapes
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§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.