Struct datamodel_renderer::datamodel::CompositeType
source · pub struct CompositeType<'a> { /* private fields */ }
Expand description
A type block in a PSL file.
Implementations§
source§impl<'a> CompositeType<'a>
impl<'a> CompositeType<'a>
sourcepub fn new(name: impl Into<Cow<'a, str>>) -> Self
pub fn new(name: impl Into<Cow<'a, str>>) -> Self
Create a new type declaration block. Will not be valid without adding at least one field.
ⓘ
type Address {
// ^^^^^^^ name
}
sourcepub fn documentation(&mut self, documentation: impl Into<Cow<'a, str>>)
pub fn documentation(&mut self, documentation: impl Into<Cow<'a, str>>)
Documentation of the type.
ⓘ
/// This is the documentation.
type Foo {
....
}
sourcepub fn push_field(&mut self, field: Field<'a>)
pub fn push_field(&mut self, field: Field<'a>)
Add a new field to the type.
ⓘ
type Foo {
bar String
// ^^^^^^^^^^ this
}
Trait Implementations§
source§impl<'a> Debug for CompositeType<'a>
impl<'a> Debug for CompositeType<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for CompositeType<'a>
impl<'a> Send for CompositeType<'a>
impl<'a> Sync for CompositeType<'a>
impl<'a> Unpin for CompositeType<'a>
impl<'a> UnwindSafe for CompositeType<'a>
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