pub struct Region(/* private fields */);Expand description
Named region within a database providing isolated storage space.
Regions grow dynamically as data is written and can be moved within the database file to optimize space usage. Each region has a unique ID for lookup.
Implementations§
Source§impl Region
impl Region
pub fn new( db: &Database, id: String, index: usize, start: u64, len: u64, reserved: u64, ) -> Self
pub fn from(db: &Database, index: usize, meta: RegionMetadata) -> Self
pub fn index(&self) -> usize
pub fn meta(&self) -> &RwLock<RegionMetadata>
pub fn db(&self) -> Database
pub fn create_reader(&self) -> Reader<'static>
pub fn open_db_read_only_file(&self) -> Result<File>
pub fn write_all_at(&self, data: &[u8], at: u64) -> Result<()>
pub fn truncate(&self, from: u64) -> Result<()>
pub fn truncate_write_all(&self, from: u64, data: &[u8]) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Region
impl !RefUnwindSafe for Region
impl Send for Region
impl Sync for Region
impl Unpin for Region
impl !UnwindSafe for Region
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more