Skip to main content

Resolved

Struct Resolved 

Source
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<()>>>();

Trait Implementations§

Source§

impl<E> AsRef<E> for Resolved<E>

Source§

fn as_ref(&self) -> &E

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<E: Clone> Clone for Resolved<E>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<E: Debug> Debug for Resolved<E>

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<E> Deref for Resolved<E>

Source§

type Target = E

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<E: Eq> Eq for Resolved<E>

Source§

impl<E: PartialEq> PartialEq for Resolved<E>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<E: PartialEq> PartialEq<E> for Resolved<E>

Source§

fn eq(&self, other: &E) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

§

impl<E> Freeze for Resolved<E>
where E: Freeze,

§

impl<E> RefUnwindSafe for Resolved<E>
where E: RefUnwindSafe,

§

impl<E> Send for Resolved<E>
where E: Send,

§

impl<E> Sync for Resolved<E>
where E: Sync,

§

impl<E> Unpin for Resolved<E>
where E: Unpin,

§

impl<E> UnsafeUnpin for Resolved<E>
where E: UnsafeUnpin,

§

impl<E> UnwindSafe for Resolved<E>
where E: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.