Skip to main content

Store

Struct Store 

Source
pub struct Store { /* private fields */ }

Implementations§

Source§

impl Store

Source

pub fn open(root: impl AsRef<Path>, quotas: StorageQuotas) -> Result<Self>

Source

pub fn root(&self) -> &Path

Source

pub fn identity_path(&self) -> PathBuf

Source

pub fn save_identity(&self, id: &PrivateIdentity) -> Result<()>

Source

pub fn load_identity(&self) -> Result<PrivateIdentity>

Source

pub fn init_identity(&self, force: bool) -> Result<PrivateIdentity>

Source

pub fn put_contact( &self, card: ContactCard, trust: TrustState, ) -> Result<PeerId>

Source

pub fn load_contacts(&self) -> Result<ContactBook>

Source

pub fn put_object( &self, env: &DropEnvelope, manifest: &Manifest, chunks: &[(u32, Vec<u8>)], ownership: Ownership, now: u64, ) -> Result<ObjectId>

Source

pub fn put_chunk( &self, object_id: ObjectId, index: u32, data: &[u8], ) -> Result<()>

Source

pub fn get_envelope(&self, id: &ObjectId) -> Result<Option<DropEnvelope>>

Source

pub fn get_manifest(&self, id: &ObjectId) -> Result<Option<Manifest>>

Source

pub fn present_mask(&self, id: &ObjectId) -> Result<Vec<bool>>

Source

pub fn load_chunks(&self, id: &ObjectId) -> Result<Vec<Vec<u8>>>

Source

pub fn load_chunk(&self, id: &ObjectId, index: u32) -> Result<Vec<u8>>

Source

pub fn inventory(&self, now: u64) -> Result<Vec<ObjectId>>

Source

pub fn complete(&self, id: &ObjectId) -> Result<bool>

Source

pub fn load_chunk_slots(&self, id: &ObjectId) -> Result<Vec<Option<Vec<u8>>>>

Source

pub fn stats(&self) -> Result<StoreStats>

Source

pub fn physical_bytes(&self) -> Result<u64>

Source

pub fn gc(&self, now: u64) -> Result<u32>

Source

pub fn verify(&self) -> Result<Vec<String>>

Source

pub fn record_encounter( &self, peer: PeerId, now: u64, sent: u64, recv: u64, ok: bool, ) -> Result<()>

Source

pub fn encounter(&self, peer: PeerId) -> Result<Option<EncounterRow>>

Source

pub fn all_encounters(&self) -> Result<Vec<(PeerId, EncounterRow)>>

Source

pub fn set_state(&self, id: &ObjectId, state: DropState) -> Result<()>

Source

pub fn decrement_replication(&self, id: &ObjectId) -> Result<u32>

Source

pub fn replication(&self, id: &ObjectId) -> Result<u32>

Source

pub fn ownership(&self, id: &ObjectId) -> Result<Ownership>

Source

pub fn bump_hop(&self, env: &mut DropEnvelope)

Source

pub fn trace(&self, id: ObjectId, ts: u64, event: &str) -> Result<()>

Source

pub fn traces(&self, id: &ObjectId) -> Result<Vec<(u64, String)>>

Source

pub fn pin(&self, id: &ObjectId) -> Result<()>

Source

pub fn unpin(&self, id: &ObjectId) -> Result<()>

Source

pub fn is_pinned(&self, id: &ObjectId) -> Result<bool>

Source

pub fn tag(&self, id: &ObjectId, tag: &str) -> Result<()>

Source

pub fn set_alias(&self, peer: PeerId, alias: &str) -> Result<()>

Source

pub fn alias(&self, peer: PeerId) -> Result<Option<String>>

Source

pub fn search_meta(&self, q: &str) -> Result<Vec<ObjectId>>

Source

pub fn put_space(&self, rec: &SpaceRecord) -> Result<()>

Source

pub fn list_spaces(&self) -> Result<Vec<SpaceRecord>>

Source

pub fn subscribe_channel(&self, sub: &ChannelSub) -> Result<()>

Source

pub fn list_channels(&self) -> Result<Vec<(String, String, String)>>

Source

pub fn put_circle(&self, name: &str, members: &[PeerId]) -> Result<()>

Source

pub fn circle_members(&self, name: &str) -> Result<Vec<PeerId>>

Source

pub fn compact(&self) -> Result<u32>

Source

pub fn quotas(&self) -> &StorageQuotas

Source

pub fn kv_get(&self, k: &str) -> Result<Option<String>>

Source

pub fn kv_set(&self, k: &str, v: &str) -> Result<()>

Source

pub fn hour_hist(&self, peer: PeerId) -> Result<[u32; 24]>

Source

pub fn put_receipt(&self, r: &Receipt) -> Result<()>

Source

pub fn receipts_for(&self, id: &ObjectId) -> Result<Vec<Receipt>>

Source

pub fn receipt_issuer_count(&self, id: &ObjectId) -> Result<u32>

Source

pub fn repair_safe(&self) -> Result<Vec<String>>

Safe repair: indexes, WAL, unreferenced chunk files. Never deletes Drop objects.

Auto Trait Implementations§

§

impl !Freeze for Store

§

impl RefUnwindSafe for Store

§

impl Send for Store

§

impl Sync for Store

§

impl Unpin for Store

§

impl UnsafeUnpin for Store

§

impl UnwindSafe for Store

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more