pub struct InstanceEntry {
pub name: Name,
pub ty: Expr,
pub priority: InstancePriority,
pub is_local: bool,
pub preferred: bool,
}Expand description
A registered type class instance.
Fields§
§name: NameName of the instance declaration.
ty: ExprType of the instance (the class application it satisfies).
priority: InstancePriorityPriority (lower = tried first).
is_local: boolWhether this is a local instance (from the context).
preferred: boolWhether this instance is preferred (used for tie-breaking).
Implementations§
Source§impl InstanceEntry
impl InstanceEntry
Sourcepub fn with_priority(self, priority: InstancePriority) -> Self
pub fn with_priority(self, priority: InstancePriority) -> Self
Set the priority of this instance.
Sourcepub fn with_local(self, is_local: bool) -> Self
pub fn with_local(self, is_local: bool) -> Self
Mark this instance as local.
Sourcepub fn with_preferred(self, preferred: bool) -> Self
pub fn with_preferred(self, preferred: bool) -> Self
Mark this instance as preferred.
Trait Implementations§
Source§impl Clone for InstanceEntry
impl Clone for InstanceEntry
Source§fn clone(&self) -> InstanceEntry
fn clone(&self) -> InstanceEntry
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 InstanceEntry
impl RefUnwindSafe for InstanceEntry
impl Send for InstanceEntry
impl Sync for InstanceEntry
impl Unpin for InstanceEntry
impl UnsafeUnpin for InstanceEntry
impl UnwindSafe for InstanceEntry
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