pub struct MemoryTarget { /* private fields */ }Expand description
A target whose bytes are held in memory: what was written, and what the last successful commit
warranted. It states what it is built with: no flush domains, WarrantyClass::Complete,
Geometry::UNALIGNED and Capabilities::NONE unless set.
Implementations§
Source§impl MemoryTarget
impl MemoryTarget
Sourcepub fn new() -> MemoryTarget
pub fn new() -> MemoryTarget
An empty target.
Sourcepub fn with_domains(
self,
domains: impl IntoIterator<Item = FlushDomain>,
) -> MemoryTarget
pub fn with_domains( self, domains: impl IntoIterator<Item = FlushDomain>, ) -> MemoryTarget
Declare its flush domains.
Sourcepub fn with_warranty(self, warranty: WarrantyClass) -> MemoryTarget
pub fn with_warranty(self, warranty: WarrantyClass) -> MemoryTarget
State its warranty class.
Sourcepub fn with_geometry(self, geometry: Geometry) -> MemoryTarget
pub fn with_geometry(self, geometry: Geometry) -> MemoryTarget
State its geometry, which the backend enforces.
Sourcepub fn with_capabilities(self, capabilities: Capabilities) -> MemoryTarget
pub fn with_capabilities(self, capabilities: Capabilities) -> MemoryTarget
State its capabilities.
Sourcepub fn contents(&self) -> &[u8] ⓘ
pub fn contents(&self) -> &[u8] ⓘ
Its bytes as written: every byte up to the end of the furthest write, zero where nothing was written.
Sourcepub fn durable_contents(&self) -> &[u8] ⓘ
pub fn durable_contents(&self) -> &[u8] ⓘ
Its bytes as of its last successful commit.
Trait Implementations§
Source§impl Clone for MemoryTarget
impl Clone for MemoryTarget
Source§fn clone(&self) -> MemoryTarget
fn clone(&self) -> MemoryTarget
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MemoryTarget
impl Debug for MemoryTarget
Source§impl Default for MemoryTarget
impl Default for MemoryTarget
Source§fn default() -> MemoryTarget
fn default() -> MemoryTarget
Returns the “default value” for a type. Read more
Source§impl IoTarget for MemoryTarget
impl IoTarget for MemoryTarget
Source§fn flush_domains(&self) -> &[FlushDomain]
fn flush_domains(&self) -> &[FlushDomain]
Every flush domain its writes depend on. The declaration must be complete; an extra domain
is safe, a missing one is not. None means it shares fate with every target.
Source§fn warranty(&self) -> WarrantyClass
fn warranty(&self) -> WarrantyClass
How far it honours its obligations.
Source§fn capabilities(&self) -> Capabilities
fn capabilities(&self) -> Capabilities
What it offers beyond its obligations.
Source§fn describe(&self) -> IoTargetDescription
fn describe(&self) -> IoTargetDescription
Everything it states, as the core takes it.
Auto Trait Implementations§
impl Freeze for MemoryTarget
impl RefUnwindSafe for MemoryTarget
impl Send for MemoryTarget
impl Sync for MemoryTarget
impl Unpin for MemoryTarget
impl UnsafeUnpin for MemoryTarget
impl UnwindSafe for MemoryTarget
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
Mutably borrows from an owned value. Read more