Skip to main content

HandleStore

Struct HandleStore 

Source
pub struct HandleStore<P: HandleProtocol> { /* private fields */ }
Expand description

Generic handle store over a HandleProtocol.

Cloneable; clones share the handle table. Implements the detached async store traits — use crate::SyncBridge for the sync traits.

Implementations§

Source§

impl<P: HandleProtocol> HandleStore<P>

Source

pub fn new(protocol: P) -> Self

Create a handle store over a protocol.

Source

pub fn handle_path(id: u64) -> Path

The handle path for an id: outstanding/{id}.

Source

pub fn live_handles(&self) -> usize

Number of live handles.

Source

pub fn handle_ids(&self) -> Vec<u64>

The ids of all live handles, ascending.

For meta/introspection lenses layered over a handle store.

Source

pub fn get_handle(&self, id: u64) -> Option<Arc<P::Handle>>

The protocol state of a live handle, if present.

For meta/introspection lenses; regular operations should go through the store interface.

Trait Implementations§

Source§

impl<P: HandleProtocol> Clone for HandleStore<P>

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<P: HandleProtocol> DetachedReader for HandleStore<P>

Source§

fn read_detached(&mut self, from: &Path) -> DetachedFuture<Option<Record>>

Begin a read; the returned future resolves independently.
Source§

impl<P: HandleProtocol> DetachedWriter for HandleStore<P>

Source§

fn write_detached(&mut self, to: &Path, data: Record) -> DetachedFuture<Path>

Begin a write; the returned future resolves independently.

Auto Trait Implementations§

§

impl<P> Freeze for HandleStore<P>
where Arc<Inner<P>>: Freeze,

§

impl<P> RefUnwindSafe for HandleStore<P>
where Arc<Inner<P>>: RefUnwindSafe,

§

impl<P> Send for HandleStore<P>
where Arc<Inner<P>>: Send,

§

impl<P> Sync for HandleStore<P>
where Arc<Inner<P>>: Sync,

§

impl<P> Unpin for HandleStore<P>
where Arc<Inner<P>>: Unpin,

§

impl<P> UnsafeUnpin for HandleStore<P>
where Arc<Inner<P>>: UnsafeUnpin,

§

impl<P> UnwindSafe for HandleStore<P>
where Arc<Inner<P>>: 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> DetachedStore for T

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<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 = !

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

fn try_from(value: U) -> Result<T, !>

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.