Skip to content

Add a trait to encode Block's invariants #11

@todo

Description

@todo

Currently, Block's invariants aren't properly encoded in the type system. They are merely documented in BlockDevice's documentation. This is, obviously, absolutely terrible. We need to come up with the correct set of functions and rules necessary for a proper Block implementation that makes this whole crate safe to use.


storage_device/src/block.rs

Lines 156 to 166 in f5f02c4

// TODO: Add a trait to encode Block's invariants
// BODY: Currently, Block's invariants aren't properly encoded in the type
// BODY: system. They are merely documented in BlockDevice's documentation.
// BODY: This is, obviously, absolutely terrible. We need to come up with
// BODY: the correct set of functions and rules necessary for a proper
// BODY: Block implementation that makes this whole crate safe to use.
type Block: Plain + Copy + Default + Deref<Target=[u8]> + DerefMut;
/// Read blocks from the block device starting at the given ``index``.
fn read(&mut self, blocks: &mut [Self::Block], index: BlockIndex) -> BlockResult<()>;


This issue was generated by todo based on a TODO comment in f5f02c4 when #8 was merged. cc @roblabla.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions