pub struct ShapeBuilder<'shape> { /* private fields */ }Expand description
Builder for Shape
Implementations§
Source§impl<'shape> ShapeBuilder<'shape>
impl<'shape> ShapeBuilder<'shape>
Sourcepub const fn new(vtable: &'shape ValueVTable) -> Self
pub const fn new(vtable: &'shape ValueVTable) -> Self
Creates a new ShapeBuilder with all fields set to None.
Sourcepub const fn id(self, id: ConstTypeId) -> Self
pub const fn id(self, id: ConstTypeId) -> Self
Sets the id field of the ShapeBuilder.
Sourcepub const fn set_unsized(self) -> Self
pub const fn set_unsized(self) -> Self
Sets the type as unsized
Sourcepub const fn type_identifier(self, type_identifier: &'shape str) -> Self
pub const fn type_identifier(self, type_identifier: &'shape str) -> Self
Sets the type_identifier field of the ShapeBuilder.
Sourcepub const fn type_params(self, type_params: &'shape [TypeParam<'shape>]) -> Self
pub const fn type_params(self, type_params: &'shape [TypeParam<'shape>]) -> Self
Sets the type_params field of the ShapeBuilder.
Sourcepub const fn doc(self, doc: &'shape [&'shape str]) -> Self
pub const fn doc(self, doc: &'shape [&'shape str]) -> Self
Sets the doc field of the ShapeBuilder.
Sourcepub const fn attributes(self, attributes: &'shape [ShapeAttribute<'_>]) -> Self
pub const fn attributes(self, attributes: &'shape [ShapeAttribute<'_>]) -> Self
Sets the attributes field of the ShapeBuilder.
Sourcepub const fn type_tag(self, type_tag: &'shape str) -> Self
pub const fn type_tag(self, type_tag: &'shape str) -> Self
Sets the type_tag field of the ShapeBuilder.
Sourcepub const fn inner(self, inner_fn: fn() -> &'shape Shape<'shape>) -> Self
pub const fn inner(self, inner_fn: fn() -> &'shape Shape<'shape>) -> Self
Sets the inner field of the ShapeBuilder.
This indicates that this shape is a transparent wrapper for another shape, like a newtype or smart pointer, and should be treated as such for serialization and deserialization.
The function inner_fn should return the static shape of the inner type.
Auto Trait Implementations§
impl<'shape> Freeze for ShapeBuilder<'shape>
impl<'shape> RefUnwindSafe for ShapeBuilder<'shape>
impl<'shape> Send for ShapeBuilder<'shape>
impl<'shape> Sync for ShapeBuilder<'shape>
impl<'shape> Unpin for ShapeBuilder<'shape>
impl<'shape> UnwindSafe for ShapeBuilder<'shape>
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