pub struct Config<T> { /* private fields */ }Expand description
Policies configuration.
Implementations§
Source§impl<T> Config<T>
impl<T> Config<T>
Sourcepub fn new(policy: SeedingPolicy, store: Store<T>) -> Config<T>
pub fn new(policy: SeedingPolicy, store: Store<T>) -> Config<T>
Create a new policy configuration.
Sourcepub fn seed_policy(&self, rid: &RepoId) -> Result<SeedPolicy, Error>
pub fn seed_policy(&self, rid: &RepoId) -> Result<SeedPolicy, Error>
Get a repository’s seeding information. Returns the default policy if the repo isn’t found.
pub fn namespaces_for<S>(
&self,
storage: &S,
rid: &RepoId,
) -> Result<Namespaces, NamespacesError>where
S: ReadStorage,
Methods from Deref<Target = Store<T>>§
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§
Auto Trait Implementations§
impl<T> Freeze for Config<T>
impl<T> !RefUnwindSafe for Config<T>
impl<T> Send for Config<T>where
T: Send,
impl<T> !Sync for Config<T>
impl<T> Unpin for Config<T>where
T: Unpin,
impl<T> !UnwindSafe for Config<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