Trait server::storage::Engine
[−]
[src]
pub trait Engine { fn create_table(&mut self) -> Result<(), Error>; fn table(&self) -> &Table; fn full_scan(&self) -> Result<Rows<Cursor<Vec<u8>>>, Error>; fn lookup(&self, column_index: usize, value: (&[u8], Option<usize>), comp: CompType) -> Result<Rows<Cursor<Vec<u8>>>, Error>; fn insert_row(&mut self, row_data: &[u8]) -> Result<u64, Error>; fn delete(&self, column_index: usize, value: (&[u8], Option<usize>), comp: CompType) -> Result<u64, Error>; fn modify(&mut self, constraint_column_index: usize, constraint_value: (&[u8], Option<usize>), comp: CompType, values: &[(usize, &[u8])]) -> Result<u64, Error>; fn reorganize(&mut self) -> Result<(), Error>; fn reset(&mut self) -> Result<(), Error>; }
Storage Engine Interface.
A storage engine, like MyISAM and InnoDB, is responsible for reading and writing data to disk, maintain and use indices, check for data corruption and repair corrupt files.
Each table in a database may use a different storage engine.
Required Methods
fn create_table(&mut self) -> Result<(), Error>
writes the table.dat file
fn table(&self) -> &Table
returns the table
fn full_scan(&self) -> Result<Rows<Cursor<Vec<u8>>>, Error>
fn lookup(&self, column_index: usize, value: (&[u8], Option<usize>), comp: CompType) -> Result<Rows<Cursor<Vec<u8>>>, Error>
fn insert_row(&mut self, row_data: &[u8]) -> Result<u64, Error>
fn delete(&self, column_index: usize, value: (&[u8], Option<usize>), comp: CompType) -> Result<u64, Error>
fn modify(&mut self, constraint_column_index: usize, constraint_value: (&[u8], Option<usize>), comp: CompType, values: &[(usize, &[u8])]) -> Result<u64, Error>
fn reorganize(&mut self) -> Result<(), Error>
fn reset(&mut self) -> Result<(), Error>
Implementors
impl<'a> Engine for FlatFile<'a>