Struct ipfs_sqlite_block_store::SizeTargets [−][src]
Size targets for a store. Gc of non-pinned blocks will start once one of the size targets is exceeded.
There are targets for both block count and block size. The reason for this is that a store that has a very large number of tiny blocks will become sluggish despite not having a large total size.
Size targets only apply to non-pinned blocks. Pinned blocks will never be gced even if exceeding one of the size targets.
Fields
count: u64
target number of blocks.
Up to this number, the store will retain everything even if not pinned. Once this number is exceeded, the store will run garbage collection of all unpinned blocks until the block criterion is met again.
To completely disable storing of non-pinned blocks, set this to 0. Even then, the store will never delete pinned blocks.
size: u64
target store size.
Up to this size, the store will retain everything even if not pinned. Once this size is exceeded, the store will run garbage collection of all unpinned blocks until the size criterion is met again.
The store will never delete pinned blocks.
Implementations
impl SizeTargets
[src]
pub fn new(count: u64, size: u64) -> Self
[src]
pub fn exceeded(&self, stats: &StoreStats) -> bool
[src]
pub fn max_value() -> Self
[src]
Size targets that can not be reached. This can be used to disable gc.
Trait Implementations
impl Clone for SizeTargets
[src]
fn clone(&self) -> SizeTargets
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for SizeTargets
[src]
impl Debug for SizeTargets
[src]
impl Default for SizeTargets
[src]
fn default() -> SizeTargets
[src]
Auto Trait Implementations
impl RefUnwindSafe for SizeTargets
impl Send for SizeTargets
impl Sync for SizeTargets
impl Unpin for SizeTargets
impl UnwindSafe for SizeTargets
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> References<RawCodec> for T
pub fn references<R, E>(
_c: RawCodec,
_r: &mut R,
_set: &mut E
) -> Result<(), Error> where
E: Extend<Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>>,
R: Read,
_c: RawCodec,
_r: &mut R,
_set: &mut E
) -> Result<(), Error> where
E: Extend<Cid<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>>,
R: Read,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,