pub struct Captures<D: GraphDriver> { /* private fields */ }Expand description
The graphs this device has instantiated, keyed by the GraphId handed to
the client.
Referencing a graph by id is what keeps the executable inside the server: nothing across the actor boundary ever holds one.
Implementations§
Source§impl<D: GraphDriver> Captures<D>
impl<D: GraphDriver> Captures<D>
Sourcepub fn insert(&mut self, id: GraphId, graph: Graph<D>)
pub fn insert(&mut self, id: GraphId, graph: Graph<D>)
Register a freshly instantiated graph under the id its capture was given.
Sourcepub fn extend_written(&self, id: GraphId, written: &mut Vec<BufferBinding>)
pub fn extend_written(&self, id: GraphId, written: &mut Vec<BufferBinding>)
Add the buffers id’s recorded launches write to written.
Extends rather than answers with a vector of its own, because the caller is filling a pooled write set and a replay should allocate for it no more than a launch does.
An unknown id adds nothing, which is the honest answer rather than a missing one: a graph that is gone took the record of which buffers went with it, and a replay of it writes nothing.
Sourcepub fn replay(
&self,
id: GraphId,
stream: &mut D::Stream,
) -> Result<(), ServerError>
pub fn replay( &self, id: GraphId, stream: &mut D::Stream, ) -> Result<(), ServerError>
Enqueue id’s recorded sequence on stream.
The stream’s existing errors are ignored — they surface on the next sync — so a replay only ever adds its own.
§Errors
ServerError::Generic when id names no live graph, which the
caller hands straight back: nothing was enqueued and nothing is stale.
Sourcepub fn destroy(&mut self, id: GraphId, stream: &mut D::Stream)
pub fn destroy(&mut self, id: GraphId, stream: &mut D::Stream)
Drop the executable id names and release what it held: the buffers it
pinned go with it, and the info-cache entries no other live graph still
pins are freed. A no-op for an unknown id, so a double release is one.
The caller syncs stream first — a replay enqueued against this
executable may still be running.
Trait Implementations§
Source§impl<D: GraphDriver> Debug for Captures<D>
impl<D: GraphDriver> Debug for Captures<D>
Auto Trait Implementations§
impl<D> !RefUnwindSafe for Captures<D>
impl<D> !UnwindSafe for Captures<D>
impl<D> Freeze for Captures<D>
impl<D> Send for Captures<D>
impl<D> Sync for Captures<D>
impl<D> Unpin for Captures<D>
impl<D> UnsafeUnpin for Captures<D>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more