pub struct InductiveTypeBuilder { /* private fields */ }Expand description
Builder for constructing InductiveType declarations incrementally.
Implementations§
Source§impl InductiveTypeBuilder
impl InductiveTypeBuilder
Sourcepub fn univ_params(self, params: Vec<Name>) -> Self
pub fn univ_params(self, params: Vec<Name>) -> Self
Set universe parameters.
Sourcepub fn num_params(self, n: u32) -> Self
pub fn num_params(self, n: u32) -> Self
Set number of type parameters.
Sourcepub fn num_indices(self, n: u32) -> Self
pub fn num_indices(self, n: u32) -> Self
Set number of type indices.
Sourcepub fn intro_rule(self, name: Name, ty: Expr) -> Self
pub fn intro_rule(self, name: Name, ty: Expr) -> Self
Add a constructor/introduction rule.
Sourcepub fn build(self) -> Result<InductiveType, String>
pub fn build(self) -> Result<InductiveType, String>
Build the InductiveType. Returns Err if name or ty is missing.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InductiveTypeBuilder
impl RefUnwindSafe for InductiveTypeBuilder
impl Send for InductiveTypeBuilder
impl Sync for InductiveTypeBuilder
impl Unpin for InductiveTypeBuilder
impl UnsafeUnpin for InductiveTypeBuilder
impl UnwindSafe for InductiveTypeBuilder
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