pub struct Store<T> { /* private fields */ }Expand description
Policy configuration.
Implementations§
Source§impl Store<Write>
impl Store<Write>
Sourcepub fn open<P>(path: P) -> Result<Store<Write>, Error>
pub fn open<P>(path: P) -> Result<Store<Write>, Error>
Open a policy store at the given path. Creates a new store if it doesn’t exist.
Sourcepub fn follow(
&mut self,
id: &PublicKey,
alias: Option<&Alias>,
) -> Result<bool, Error>
pub fn follow( &mut self, id: &PublicKey, alias: Option<&Alias>, ) -> Result<bool, Error>
Follow a node.
Sourcepub fn set_follow_policy(
&mut self,
id: &PublicKey,
policy: Policy,
) -> Result<bool, Error>
pub fn set_follow_policy( &mut self, id: &PublicKey, policy: Policy, ) -> Result<bool, Error>
Set a node’s follow policy.
Source§impl<T> Store<T>
Read methods for Config. This implies that a
Config<Write> can access these functions as well.
impl<T> Store<T>
Read methods for Config. This implies that a
Config<Write> can access these functions as well.
Sourcepub fn follow_policy(
&self,
id: &PublicKey,
) -> Result<Option<FollowPolicy>, Error>
pub fn follow_policy( &self, id: &PublicKey, ) -> Result<Option<FollowPolicy>, Error>
Get a node’s follow policy.
Sourcepub fn seed_policy(&self, id: &RepoId) -> Result<Option<SeedPolicy>, Error>
pub fn seed_policy(&self, id: &RepoId) -> Result<Option<SeedPolicy>, Error>
Get a repository’s seeding policy.
Sourcepub fn follow_policies(&self) -> Result<FollowPolicies<'_>, Error>
pub fn follow_policies(&self) -> Result<FollowPolicies<'_>, Error>
Get node follow policies.
Sourcepub fn seed_policies(&self) -> Result<SeedPolicies<'_>, Error>
pub fn seed_policies(&self) -> Result<SeedPolicies<'_>, Error>
Get repository seed policies.
pub fn nodes_by_alias<'a>( &'a self, alias: &Alias, ) -> Result<NodeAliasIter<'a>, Error>
Trait Implementations§
Source§impl<T> AliasStore for Store<T>
impl<T> AliasStore for Store<T>
Auto Trait Implementations§
impl<T> Freeze for Store<T>
impl<T> !RefUnwindSafe for Store<T>
impl<T> Send for Store<T>where
T: Send,
impl<T> !Sync for Store<T>
impl<T> Unpin for Store<T>where
T: Unpin,
impl<T> !UnwindSafe for Store<T>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more