pub trait Block<B: Backend> {
// Required methods
fn properties(&self) -> Properties;
fn memory(&self) -> &B::Memory;
fn range(&self) -> Range<u64>;
fn map<'a>(
&'a mut self,
device: &B::Device,
range: Range<u64>,
) -> Result<MappedRange<'a, B>, MapError>;
fn unmap(&mut self, device: &B::Device);
// Provided method
fn size(&self) -> u64 { ... }
}
Expand description
Block that owns a Range
of the Memory
.
Implementor must ensure that there can’t be any other blocks
with overlapping range (either through type system or safety notes for unsafe functions).
Provides access to safe memory range mapping.
Required Methods§
Sourcefn properties(&self) -> Properties
fn properties(&self) -> Properties
Get memory properties of the block.