pub struct WhereClause {
pub name: String,
pub params: Vec<Binder>,
pub ty: Option<Located<SurfaceExpr>>,
pub val: Located<SurfaceExpr>,
}Expand description
A where clause for local definitions attached to a definition or theorem.
Example:
def foo (n : Nat) : Nat := bar n + baz n where
bar (x : Nat) : Nat := x + 1
baz (x : Nat) : Nat := x * 2Fields§
§name: StringName of the local definition.
params: Vec<Binder>Parameters of the local definition.
ty: Option<Located<SurfaceExpr>>Optional type annotation.
val: Located<SurfaceExpr>Value (body) of the local definition.
Implementations§
Source§impl WhereClause
impl WhereClause
Sourcepub fn new(
name: String,
params: Vec<Binder>,
ty: Option<Located<SurfaceExpr>>,
val: Located<SurfaceExpr>,
) -> Self
pub fn new( name: String, params: Vec<Binder>, ty: Option<Located<SurfaceExpr>>, val: Located<SurfaceExpr>, ) -> Self
Create a new where clause.
Trait Implementations§
Source§impl Clone for WhereClause
impl Clone for WhereClause
Source§fn clone(&self) -> WhereClause
fn clone(&self) -> WhereClause
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 WhereClause
impl Debug for WhereClause
Source§impl Display for WhereClause
impl Display for WhereClause
Source§impl PartialEq for WhereClause
impl PartialEq for WhereClause
impl StructuralPartialEq for WhereClause
Auto Trait Implementations§
impl Freeze for WhereClause
impl RefUnwindSafe for WhereClause
impl Send for WhereClause
impl Sync for WhereClause
impl Unpin for WhereClause
impl UnsafeUnpin for WhereClause
impl UnwindSafe for WhereClause
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