Skip to main content

Pool

Struct Pool 

Source
pub struct Pool { /* private fields */ }
Expand description

Values the records of one cache file share, each written once, by the digest of its text: a model’s faces, which every revision of the model that kept them holds alike.

Implementations§

Source§

impl Pool

Source

pub fn put<V: Serialize>(&mut self, value: &V) -> GeopResult<String>

Puts value, and gives what it is taken by (Pool::get).

Source

pub fn get<V: DeserializeOwned>(&self, key: &str) -> GeopResult<V>

The value put as key.

Source

pub fn shared<V: 'static>( &self, key: &str, read: impl FnOnce() -> GeopResult<V>, ) -> GeopResult<Rc<V>>

What read reads of the value put as key, read once for every record that reads it so: what many records hold alike — the drawing of a part placed a thousand times — is one value in memory. read reads the same of the same key, as a V.

Source

pub fn len(&self) -> usize

How many values it holds.

Source

pub fn is_empty(&self) -> bool

Whether it holds none.

Trait Implementations§

Source§

impl Default for Pool

Source§

fn default() -> Pool

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !Freeze for Pool

§

impl !RefUnwindSafe for Pool

§

impl !Send for Pool

§

impl !Sync for Pool

§

impl !UnwindSafe for Pool

§

impl Unpin for Pool

§

impl UnsafeUnpin for Pool

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.