pub struct ClassBuilder { /* private fields */ }Expand description
Builder for class types
Note: All methods are fallible because the underlying class could be deleted while you hold a reference to the builder.
Implementations§
Source§impl ClassBuilder
impl ClassBuilder
Sourcepub fn add_property(
&self,
name: &str,
field_type: &TypeDef,
) -> Result<ClassPropertyBuilder, BamlError>
pub fn add_property( &self, name: &str, field_type: &TypeDef, ) -> Result<ClassPropertyBuilder, BamlError>
Add a property to this class
Sourcepub fn get_property(&self, name: &str) -> Option<ClassPropertyBuilder>
pub fn get_property(&self, name: &str) -> Option<ClassPropertyBuilder>
Get a property by name (if it exists)
Sourcepub fn list_properties(&self) -> Result<Vec<ClassPropertyBuilder>, BamlError>
pub fn list_properties(&self) -> Result<Vec<ClassPropertyBuilder>, BamlError>
List all properties
Trait Implementations§
Source§impl BamlEncode for ClassBuilder
impl BamlEncode for ClassBuilder
Source§fn baml_encode(&self) -> HostValue
fn baml_encode(&self) -> HostValue
Encode to a
HostValue (inbound schema)Source§impl Clone for ClassBuilder
impl Clone for ClassBuilder
Source§fn clone(&self) -> ClassBuilder
fn clone(&self) -> ClassBuilder
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 moreAuto Trait Implementations§
impl Freeze for ClassBuilder
impl RefUnwindSafe for ClassBuilder
impl Send for ClassBuilder
impl Sync for ClassBuilder
impl Unpin for ClassBuilder
impl UnwindSafe for ClassBuilder
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