pub struct Resolved<E>(/* private fields */);Expand description
A read-only capability for one resolved endpoint snapshot.
The snapshot remains valid after its registration is released or its
address is reused. Its storage and reclamation mechanism are intentionally
opaque; consumers can access the endpoint through core::ops::Deref or
AsRef but cannot reconstruct registration authority from it.
Resolved endpoints are read-only capabilities. The wrapper does not grant
mutable access, construction, destructuring, or registration authority.
As with any shared Rust reference, an endpoint may still expose deliberate
interior-mutability operations through &self.
use bombay_address::AddressSpace;
let space = AddressSpace::new();
let _lease = space.claim("worker", String::from("endpoint")).unwrap();
let mut endpoint = space.resolve(&"worker").unwrap();
endpoint.push_str("-mutated");Its private field prevents consumers from constructing or destructuring it:
use bombay_address::Resolved;
let endpoint = Resolved(String::from("forged"));
let Resolved(inner) = endpoint;The endpoint cannot be moved out through the shared dereference:
use bombay_address::AddressSpace;
let space = AddressSpace::new();
let _lease = space.claim("worker", String::from("endpoint")).unwrap();
let endpoint = space.resolve(&"worker").unwrap();
let inner: String = *endpoint;Resolution does not confer release authority:
use bombay_address::AddressSpace;
let space = AddressSpace::new();
let _lease = space.claim("worker", String::from("endpoint")).unwrap();
let endpoint = space.resolve(&"worker").unwrap();
endpoint.release();Send and Sync are inherited from E; the wrapper does not manufacture
either property for an endpoint that lacks it:
use bombay_address::Resolved;
use std::rc::Rc;
fn assert_send<T: Send>() {}
assert_send::<Resolved<Rc<()>>>();use bombay_address::Resolved;
use std::cell::Cell;
fn assert_sync<T: Sync>() {}
assert_sync::<Resolved<Cell<()>>>();