pub enum ResizeAlgorithm {
Monero,
FixedBytes(NonZeroUsize),
Percent(f32),
}
Expand description
The function/algorithm used by the database when resizing the memory map.
Variants§
Implementations§
Source§impl ResizeAlgorithm
impl ResizeAlgorithm
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Returns Self::Monero
.
assert!(matches!(ResizeAlgorithm::new(), ResizeAlgorithm::Monero));
Sourcepub fn resize(&self, current_size_bytes: usize) -> NonZeroUsize
pub fn resize(&self, current_size_bytes: usize) -> NonZeroUsize
Maps the self
variant to the free functions in crate::resize
.
This function returns the new memory map size in bytes.
Trait Implementations§
Source§impl Clone for ResizeAlgorithm
impl Clone for ResizeAlgorithm
Source§fn clone(&self) -> ResizeAlgorithm
fn clone(&self) -> ResizeAlgorithm
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ResizeAlgorithm
impl Debug for ResizeAlgorithm
Source§impl Default for ResizeAlgorithm
impl Default for ResizeAlgorithm
Source§impl<'de> Deserialize<'de> for ResizeAlgorithm
impl<'de> Deserialize<'de> for ResizeAlgorithm
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ResizeAlgorithm
impl PartialEq for ResizeAlgorithm
Source§impl PartialOrd for ResizeAlgorithm
impl PartialOrd for ResizeAlgorithm
Source§impl Serialize for ResizeAlgorithm
impl Serialize for ResizeAlgorithm
impl Copy for ResizeAlgorithm
impl StructuralPartialEq for ResizeAlgorithm
Auto Trait Implementations§
impl Freeze for ResizeAlgorithm
impl RefUnwindSafe for ResizeAlgorithm
impl Send for ResizeAlgorithm
impl Sync for ResizeAlgorithm
impl Unpin for ResizeAlgorithm
impl UnwindSafe for ResizeAlgorithm
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 16 bytes
Size for each variant:
Monero
: 0 bytesFixedBytes
: 12 bytesPercent
: 4 bytes