[][src]Trait hycon_rust::database::block_file::BlockFileOps

pub trait BlockFileOps: Sized {
    fn new(
        path: &PathBuf,
        file_number: u32,
        file_position: u64
    ) -> BlockFileResult<Self>;
fn get<T>(
        &mut self,
        file_number: u32,
        offset: u64,
        length: usize
    ) -> BlockFileResult<T>
    where
        T: Decode
;
fn put<T>(&mut self, any_block: &mut T) -> BlockFileResult<PutResult>
    where
        T: Encode + Proto
; }

Required methods

fn new(
    path: &PathBuf,
    file_number: u32,
    file_position: u64
) -> BlockFileResult<Self>

fn get<T>(
    &mut self,
    file_number: u32,
    offset: u64,
    length: usize
) -> BlockFileResult<T> where
    T: Decode

fn put<T>(&mut self, any_block: &mut T) -> BlockFileResult<PutResult> where
    T: Encode + Proto

Loading content...

Implementors

impl<RawFile> BlockFileOps for BlockFile<RawFile> where
    RawFile: Read + Write + Seek + MiscFileOp
[src]

fn new(
    path: &PathBuf,
    file_number: u32,
    file_position: u64
) -> BlockFileResult<BlockFile<RawFile>>
[src]

Create, initialise and return an object of BlockFile

fn get<T>(
    &mut self,
    file_number: u32,
    offset: u64,
    length: usize
) -> BlockFileResult<T> where
    T: Decode
[src]

Retrieve an object of Block or GenesisBlock from the file system represented by this BlockFile object

fn put<T>(&mut self, any_block: &mut T) -> BlockFileResult<PutResult> where
    T: Encode + Proto
[src]

Write a Block or GenesisBlock object to the file system represented by this BlockFile object

Loading content...