pub struct ShapeSet { /* private fields */ }
Expand description
A set of Shape
values, which correctly handles the relationship between
newtype and tuple shapes.
let shape_set = ShapeSet::new(vec![Shape::Tuple]);
assert!(shape_set.contains(&Shape::Newtype));
Create a new ShapeSet
which includes the specified items.
let shape_set = ShapeSet::new(vec![Shape::Named, Shape::Newtype]);
assert!(shape_set.contains(&Shape::Newtype));
Insert all possible shapes into the set.
This is equivalent to calling insert
with every value of Shape
.
let mut shape_set = ShapeSet::default();
shape_set.insert_all();
assert!(shape_set.contains(&Shape::Named));
Insert a shape into the set, so that the set will match that shape
Whether this set is empty.
Check if a fields container’s shape is in this set.
Check if a field container’s shape is in this set of shapes, and produce
an Error
if it does not.
Performs copy-assignment from
source
.
Read more
Formats the value using the given formatter.
Read more
Returns the “default value” for a type.
Read more
Formats the value using the given formatter.
Read more
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more
Uses borrowed data to replace owned data, usually by cloning.
Read more
Converts the given value to a
String
.
Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.