Skip to main content

RelocatingStreams

Trait RelocatingStreams 

Source
pub trait RelocatingStreams {
Show 14 methods // Required methods fn recording(&mut self) -> bool; fn has_outdated(&mut self) -> bool; fn relocation_need(&mut self) -> RelocationNeed; fn bytes_allocated(&mut self) -> u64; fn finish(&mut self); fn relocate_memory(&mut self, reason: RelocationReason); fn device_has_outdated(&mut self) -> bool; fn relocate_device_memory(&mut self, reason: RelocationReason); fn cleanup_memory(&mut self); // Provided methods fn refuse_while_recording(&mut self) -> Result<(), ServerError> { ... } fn reclaim(&mut self) -> Result<(), ServerError> { ... } fn relocate_when_wanted(&mut self) { ... } fn relocate(&mut self, reason: RelocationReason) { ... } fn relocate_device(&mut self, reason: RelocationReason) { ... }
}
Expand description

A runtime’s streams, as relocating one stream’s memory needs them.

A relocation moves memory any stream may still read or write, so every stream’s work is done before a byte moves; and nothing moves while a graph records, since the pages it touches keep their addresses until it seals. The runtime supplies each step. The order they run in lives here, once.

Required Methods§

Source

fn recording(&mut self) -> bool

Whether any stream is recording a graph.

Source

fn has_outdated(&mut self) -> bool

Whether a growth left pages behind in the relocating stream’s memory: without any, a relocation has nothing to move and waits on nothing.

Source

fn relocation_need(&mut self) -> RelocationNeed

Whether the relocating stream’s memory wants a relocation, before the bytes the device holds are known.

Source

fn bytes_allocated(&mut self) -> u64

The bytes every stream’s memory holds from the device.

Source

fn finish(&mut self)

Get every stream’s queued and submitted work done, or leave it to the CopyQueue to wait for before its first copy.

Source

fn relocate_memory(&mut self, reason: RelocationReason)

Move what the relocating stream’s memory holds on outdated pages.

Source

fn device_has_outdated(&mut self) -> bool

Whether a growth left pages behind in any stream’s memory.

Source

fn relocate_device_memory(&mut self, reason: RelocationReason)

Move what every stream’s memory holds on outdated pages.

Source

fn cleanup_memory(&mut self)

Give back every page the relocating stream’s memory holds and nothing needs.

Provided Methods§

Source

fn refuse_while_recording(&mut self) -> Result<(), ServerError>

Refuse while any stream records a graph: the pages a recording touches keep their addresses until it seals, and nothing may wait on the device under it.

What reclaim checks first, for a caller with work of its own to refuse before it.

§Errors

ServerError naming the recording when a stream records.

Source

fn reclaim(&mut self) -> Result<(), ServerError>

Give back everything the relocating stream’s memory holds and nothing needs: what the outdated pages still hold moves first, while the current pages keep the room it moves into, then every page left empty goes back.

§Errors

Refused while any stream records a graph, see refuse_while_recording.

Source

fn relocate_when_wanted(&mut self)

Relocate when the memory asks for it: while the device still has a page to spare, or before the pools run out of page sizes.

Source

fn relocate(&mut self, reason: RelocationReason)

Relocate for reason, unless a graph records or nothing is outdated.

Source

fn relocate_device(&mut self, reason: RelocationReason)

Relocate every stream’s memory for reason, unless a graph records or nothing is outdated anywhere.

What a capture does before its warmup: a recording may touch memory any stream owns, and every page it touches is guarded for the graph’s life, where no relocation can empty it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§