pub struct StructTypeBuilder { /* private fields */ }Expand description
Builder for StructType to enable shorter derive macro output
§Example
use facet_core::{StructTypeBuilder, StructKind, Field, StructType};
const FIELDS: &[Field] = &[];
const STRUCT_TYPE: StructType =
StructTypeBuilder::new(StructKind::Struct, FIELDS).build();Implementations§
Source§impl StructTypeBuilder
impl StructTypeBuilder
Sourcepub const fn new(kind: StructKind, fields: &'static [Field]) -> Self
pub const fn new(kind: StructKind, fields: &'static [Field]) -> Self
Create a new StructTypeBuilder with the given kind and fields
The representation defaults to Repr::c() if not explicitly set via Self::repr
Sourcepub const fn build(self) -> StructType
pub const fn build(self) -> StructType
Build the final StructType
Trait Implementations§
Source§impl Clone for StructTypeBuilder
impl Clone for StructTypeBuilder
Source§fn clone(&self) -> StructTypeBuilder
fn clone(&self) -> StructTypeBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StructTypeBuilder
impl Debug for StructTypeBuilder
impl Copy for StructTypeBuilder
Auto Trait Implementations§
impl Freeze for StructTypeBuilder
impl RefUnwindSafe for StructTypeBuilder
impl Send for StructTypeBuilder
impl Sync for StructTypeBuilder
impl Unpin for StructTypeBuilder
impl UnwindSafe for StructTypeBuilder
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