Skip to main content

BlockstorePinner

Struct BlockstorePinner 

Source
pub struct BlockstorePinner<'a, B: Blockstore> { /* private fields */ }
Expand description

Default pinner implementation using a blockstore and pin store

Implementations§

Source§

impl<'a, B: Blockstore> BlockstorePinner<'a, B>

Source

pub fn new(blockstore: &'a B, store: PinStore) -> Self

Create a new pinner

Source

pub fn store(&self) -> &PinStore

Get a reference to the pin store

Source

pub fn store_mut(&mut self) -> &mut PinStore

Get a mutable reference to the pin store

Trait Implementations§

Source§

impl<'a, B: Blockstore> Pinner for BlockstorePinner<'a, B>

Source§

fn is_pinned(&self, cid: &Cid) -> PinResult<bool>

Check if a CID is pinned (any mode)
Source§

fn is_pinned_with_mode(&self, cid: &Cid, mode: PinMode) -> PinResult<bool>

Check if a CID is pinned with a specific mode
Source§

fn pin(&mut self, cid: &Cid, mode: PinMode) -> PinResult<()>

Pin a CID with the specified mode
Source§

fn pin_with_name( &mut self, cid: &Cid, mode: PinMode, name: Option<String>, ) -> PinResult<()>

Pin a CID with the specified mode and name
Source§

fn unpin(&mut self, cid: &Cid, recursive: bool) -> PinResult<()>

Unpin a CID
Source§

fn get_pin(&self, cid: &Cid) -> PinResult<Option<PinInfo>>

Get pin info for a CID
Source§

fn list_pins(&self, mode: Option<PinMode>) -> PinResult<Vec<PinInfo>>

List all pins, optionally filtered by mode
Source§

fn update_pin(&mut self, old: &Cid, new: &Cid, unpin: bool) -> PinResult<()>

Update a pin from old CID to new CID
Source§

fn verify(&self) -> PinResult<Vec<(Cid, String)>>

Verify all pins (check that all pinned blocks exist)
Source§

fn pinned_cids(&self) -> PinResult<HashSet<Cid>>

Get all CIDs that should not be garbage collected

Auto Trait Implementations§

§

impl<'a, B> !Freeze for BlockstorePinner<'a, B>

§

impl<'a, B> !RefUnwindSafe for BlockstorePinner<'a, B>

§

impl<'a, B> Send for BlockstorePinner<'a, B>

§

impl<'a, B> Sync for BlockstorePinner<'a, B>

§

impl<'a, B> Unpin for BlockstorePinner<'a, B>

§

impl<'a, B> UnsafeUnpin for BlockstorePinner<'a, B>

§

impl<'a, B> UnwindSafe for BlockstorePinner<'a, B>
where B: RefUnwindSafe,

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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V