pub struct ShapeDef {
pub description: Option<String>,
pub kind: Kind,
}Expand description
A shape with the description that documents it.
Fields§
§description: Option<String>§kind: KindImplementations§
Source§impl ShapeDef
impl ShapeDef
pub fn new(kind: Kind) -> Self
pub fn described(self, description: &str) -> Self
Sourcepub fn constant_bool(self, value: bool) -> Self
pub fn constant_bool(self, value: bool) -> Self
Replaces the shape with exactly the boolean value.
Sourcepub fn constant_string(self, value: &str) -> Self
pub fn constant_string(self, value: &str) -> Self
Replaces the shape with exactly the string value.
Sourcepub fn constrained(self, constraint: Constraint) -> Self
pub fn constrained(self, constraint: Constraint) -> Self
Adds constraint.
§Panics
When the constraint does not apply to this kind of shape, or a pattern is outside the supported subset
(see crate::Pattern). A derive attribute that does either is a mistake in the type, found the first time
its definitions are built.
Trait Implementations§
impl StructuralPartialEq for ShapeDef
Auto Trait Implementations§
impl Forget for ShapeDef
impl Freeze for ShapeDef
impl Move for ShapeDef
impl RefUnwindSafe for ShapeDef
impl Send for ShapeDef
impl Sync for ShapeDef
impl Unpin for ShapeDef
impl UnsafeUnpin for ShapeDef
impl UnwindSafe for ShapeDef
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