pub trait ObjectHandle: Send + Sync + 'static {
    // Required methods
    fn object_id(&self) -> u64;
    fn get_size(&self) -> u64;
    fn block_size(&self) -> u64;
    fn allocate_buffer(&self, size: usize) -> Buffer<'_>;

    // Provided method
    fn set_trace(&self, _v: bool) { ... }
Expand description

A handle for a generic object. For objects with a data payload, use the ReadObjectHandle or WriteObjectHandle traits.

Required Methods§


fn object_id(&self) -> u64

Returns the object identifier for this object which will be unique for the store that the object is contained in, but not necessarily unique within the entire system.


fn get_size(&self) -> u64


fn block_size(&self) -> u64

Returns the filesystem block size, which should be at least as big as the device block size, but not necessarily the same.


fn allocate_buffer(&self, size: usize) -> Buffer<'_>

Allocates a buffer for doing I/O (read and write) for the object.

Provided Methods§


fn set_trace(&self, _v: bool)

Sets tracing for this object.