pub struct ReceiverDomain(/* private fields */);Expand description
One evaluator’s nonreused receiver-construction namespace.
The owner keeps this capability private. Exhaustion declines provenance; it never reuses another owner’s identity or affects value semantics.
use dive_value::{Ctx, ReceiverDomain, Value, tlc};
if let Some(owner) = ReceiverDomain::new() {
let tuple = owner.tuple(vec![Value::Int(1)], 7, true);
let caught = tlc::equals(&tuple, &Value::FALSE, Ctx::tlc())
.err().and_then(|error| error.receiver_failure());
assert_eq!(caught.and_then(|failure| owner.recover(failure)), Some((7, true)));
}Implementations§
Source§impl ReceiverDomain
impl ReceiverDomain
Sourcepub fn new() -> Option<Self>
pub fn new() -> Option<Self>
Creates an owner capability, or declines if its packed identity is exhausted.
Sourcepub fn tuple(&self, values: Vec<Value>, node: u32, diagnostic: bool) -> Value
pub fn tuple(&self, values: Vec<Value>, node: u32, diagnostic: bool) -> Value
Builds an actual tuple constructor with this owner’s source-hook facts. Reusing a cached/shared value never calls this constructor.
Trait Implementations§
Auto Trait Implementations§
impl Forget for ReceiverDomain
impl Freeze for ReceiverDomain
impl Move for ReceiverDomain
impl RefUnwindSafe for ReceiverDomain
impl Send for ReceiverDomain
impl Sync for ReceiverDomain
impl Unpin for ReceiverDomain
impl UnsafeUnpin for ReceiverDomain
impl UnwindSafe for ReceiverDomain
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