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§
Sourcefn has_outdated(&mut self) -> bool
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.
Sourcefn relocation_need(&mut self) -> RelocationNeed
fn relocation_need(&mut self) -> RelocationNeed
Whether the relocating stream’s memory wants a relocation, before the bytes the device holds are known.
Sourcefn bytes_allocated(&mut self) -> u64
fn bytes_allocated(&mut self) -> u64
The bytes every stream’s memory holds from the device.
Sourcefn finish(&mut self)
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.
Sourcefn relocate_memory(&mut self, reason: RelocationReason)
fn relocate_memory(&mut self, reason: RelocationReason)
Move what the relocating stream’s memory holds on outdated pages.
Sourcefn device_has_outdated(&mut self) -> bool
fn device_has_outdated(&mut self) -> bool
Whether a growth left pages behind in any stream’s memory.
Sourcefn relocate_device_memory(&mut self, reason: RelocationReason)
fn relocate_device_memory(&mut self, reason: RelocationReason)
Move what every stream’s memory holds on outdated pages.
Sourcefn cleanup_memory(&mut self)
fn cleanup_memory(&mut self)
Give back every page the relocating stream’s memory holds and nothing needs.
Provided Methods§
Sourcefn refuse_while_recording(&mut self) -> Result<(), ServerError>
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.
Sourcefn reclaim(&mut self) -> Result<(), ServerError>
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.
Sourcefn relocate_when_wanted(&mut self)
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.
Sourcefn relocate(&mut self, reason: RelocationReason)
fn relocate(&mut self, reason: RelocationReason)
Relocate for reason, unless a graph records or nothing is outdated.
Sourcefn relocate_device(&mut self, reason: RelocationReason)
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".