pub struct ShapeBuilder { /* private fields */ }Expand description
Builder for Shape
Implementations§
Source§impl ShapeBuilder
impl ShapeBuilder
Sourcepub const fn new() -> ShapeBuilder
pub const fn new() -> ShapeBuilder
Creates a new ShapeBuilder with all fields set to None.
Sourcepub const fn id(self, id: ConstTypeId) -> ShapeBuilder
pub const fn id(self, id: ConstTypeId) -> ShapeBuilder
Sets the id field of the ShapeBuilder.
Sourcepub const fn vtable(self, vtable: ValueVTable) -> ShapeBuilder
pub const fn vtable(self, vtable: ValueVTable) -> ShapeBuilder
Sets the vtable field of the ShapeBuilder.
Sourcepub const fn layout(self, layout: Layout) -> ShapeBuilder
pub const fn layout(self, layout: Layout) -> ShapeBuilder
Sets the layout field of the ShapeBuilder.
Sourcepub const fn set_unsized(self) -> ShapeBuilder
pub const fn set_unsized(self) -> ShapeBuilder
Sets the type as unsized
Sourcepub const fn def(self, def: Def) -> ShapeBuilder
pub const fn def(self, def: Def) -> ShapeBuilder
Sets the def field of the ShapeBuilder.
Sourcepub const fn ty(self, ty: Type) -> ShapeBuilder
pub const fn ty(self, ty: Type) -> ShapeBuilder
Sets the ty field of the ShapeBuilder.
Sourcepub const fn type_identifier(
self,
type_identifier: &'static str,
) -> ShapeBuilder
pub const fn type_identifier( self, type_identifier: &'static str, ) -> ShapeBuilder
Sets the type_identifier field of the ShapeBuilder.
Sourcepub const fn type_params(
self,
type_params: &'static [TypeParam],
) -> ShapeBuilder
pub const fn type_params( self, type_params: &'static [TypeParam], ) -> ShapeBuilder
Sets the type_params field of the ShapeBuilder.
Sourcepub const fn doc(self, doc: &'static [&'static str]) -> ShapeBuilder
pub const fn doc(self, doc: &'static [&'static str]) -> ShapeBuilder
Sets the doc field of the ShapeBuilder.
Sourcepub const fn attributes(
self,
attributes: &'static [ShapeAttribute],
) -> ShapeBuilder
pub const fn attributes( self, attributes: &'static [ShapeAttribute], ) -> ShapeBuilder
Sets the attributes field of the ShapeBuilder.
Sourcepub const fn type_tag(self, type_tag: &'static str) -> ShapeBuilder
pub const fn type_tag(self, type_tag: &'static str) -> ShapeBuilder
Sets the type_tag field of the ShapeBuilder.
Sourcepub const fn inner(self, inner_shape: &'static Shape) -> ShapeBuilder
pub const fn inner(self, inner_shape: &'static Shape) -> ShapeBuilder
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 inner_shape parameter should be the static shape of the inner type.