pub struct Profile {
pub home: Home,
pub storage: Storage,
pub keystore: Keystore,
pub public_key: PublicKey,
pub config: Config,
}Fields§
§home: Home§storage: Storage§keystore: Keystore§public_key: PublicKey§config: ConfigImplementations§
Source§impl Profile
impl Profile
pub fn init( home: Home, alias: Alias, passphrase: Option<Zeroizing<String>>, seed: Seed, ) -> Result<Profile, Error>
pub fn load() -> Result<Profile, Error>
pub fn id(&self) -> &PublicKey
pub fn info(&self) -> UserInfo
pub fn hints(&self) -> bool
pub fn did(&self) -> Did
pub fn signer(&self) -> Result<BoxedDevice, SignerError>
Sourcepub fn policies(&self) -> Result<Config<Read>, Error>
pub fn policies(&self) -> Result<Config<Read>, Error>
Return a read-only handle to the policies of the node.
Sourcepub fn add_inventory(&self, rid: RepoId, node: &mut Node) -> Result<bool, Error>
pub fn add_inventory(&self, rid: RepoId, node: &mut Node) -> Result<bool, Error>
Add the repo to our inventory. If the node is offline, adds it directly to the database.
Sourcepub fn seed(
&self,
rid: RepoId,
scope: Scope,
node: &mut Node,
) -> Result<bool, Error>
pub fn seed( &self, rid: RepoId, scope: Scope, node: &mut Node, ) -> Result<bool, Error>
Seed a repository by first trying to seed through the node, and if the node isn’t running, by updating the policy database directly. If the repo is available locally, we also add it to our inventory.
Sourcepub fn unseed(&self, rid: RepoId, node: &mut Node) -> Result<bool, Error>
pub fn unseed(&self, rid: RepoId, node: &mut Node) -> Result<bool, Error>
Unseed a repository by first trying to unseed through the node, and if the node isn’t running, by updating the policy database directly.
Sourcepub fn database_mut(&self) -> Result<Database, Error>
pub fn database_mut(&self) -> Result<Database, Error>
Return a handle to the database of the node, with SQLite configuration
from Self::config applied.
Methods from Deref<Target = Home>§
pub fn path(&self) -> &Path
Sourcepub fn storage(&self) -> PathBuf
pub fn storage(&self) -> PathBuf
The /storage directory under Home::path.
Sourcepub fn config(&self) -> PathBuf
pub fn config(&self) -> PathBuf
The config.json file path under Home::path.
Sourcepub fn keys(&self) -> PathBuf
pub fn keys(&self) -> PathBuf
The /keys directory under Home::path.
Sourcepub fn node(&self) -> PathBuf
pub fn node(&self) -> PathBuf
The /node directory under Home::path.
Sourcepub fn cobs(&self) -> PathBuf
pub fn cobs(&self) -> PathBuf
The /cobs directory under Home::path.
Sourcepub fn socket_from_env(&self) -> PathBuf
pub fn socket_from_env(&self) -> PathBuf
The location of the control socket of the node.
If the environment variable with name env::RAD_SOCKET is set,
its value is used.
Otherwise, the default socket name, which is relative to this
Home, is used (see Self::socket_default).
Sourcepub fn socket_default(&self) -> PathBuf
pub fn socket_default(&self) -> PathBuf
The default location of the control socket of the node.
The returned value only depends on self, and not on
any environment variables.
See also Self::socket_from_env.
Sourcepub fn notifications_mut(&self) -> Result<Store<Write>, Error>
pub fn notifications_mut(&self) -> Result<Store<Write>, Error>
Return a read-write handle to the notifications database.
Sourcepub fn policies_mut(&self) -> Result<Store<Write>, Error>
pub fn policies_mut(&self) -> Result<Store<Write>, Error>
Return a read-write handle to the policies store of the node.
Sourcepub fn database(&self, config: Config) -> Result<Database, Error>
pub fn database(&self, config: Config) -> Result<Database, Error>
Return a handle to a read-only database of the node.
Sourcepub fn database_mut(&self, config: Config) -> Result<Database, Error>
pub fn database_mut(&self, config: Config) -> Result<Database, Error>
Return a handle to the database of the node.
Sourcepub fn addresses(&self, config: Config) -> Result<impl Store + use<>, Error>
pub fn addresses(&self, config: Config) -> Result<impl Store + use<>, Error>
Returns the address store.
Sourcepub fn routing(&self, config: Config) -> Result<impl Store + use<>, Error>
pub fn routing(&self, config: Config) -> Result<impl Store + use<>, Error>
Returns the routing store.
Sourcepub fn routing_mut(&self, config: Config) -> Result<impl Store + use<>, Error>
pub fn routing_mut(&self, config: Config) -> Result<impl Store + use<>, Error>
Returns the routing store, mutably.
Sourcepub fn issues<'a, Repo>(
&self,
repository: &'a Repo,
) -> Result<Cache<'a, Repo, ReadOnly, Store<Read>>, Error>
pub fn issues<'a, Repo>( &self, repository: &'a Repo, ) -> Result<Cache<'a, Repo, ReadOnly, Store<Read>>, Error>
Return a read-only handle for the issues cache.
Sourcepub fn issues_mut<'a, 'b, Repo, Signer>(
&self,
repository: &'a Repo,
signer: &'b Signer,
) -> Result<Cache<'a, Repo, WriteAs<'b, Signer>, Store<Write>>, Error>
pub fn issues_mut<'a, 'b, Repo, Signer>( &self, repository: &'a Repo, signer: &'b Signer, ) -> Result<Cache<'a, Repo, WriteAs<'b, Signer>, Store<Write>>, Error>
Return a read-write handle for the issues cache.
Sourcepub fn patches<'a, Repo>(
&self,
repository: &'a Repo,
) -> Result<Cache<'a, Repo, ReadOnly, Store<Read>>, Error>
pub fn patches<'a, Repo>( &self, repository: &'a Repo, ) -> Result<Cache<'a, Repo, ReadOnly, Store<Read>>, Error>
Return a read-only handle for the patches cache.
Sourcepub fn patches_mut<'a, 'b, Repo, Signer>(
&self,
repository: &'a Repo,
signer: &'b Signer,
) -> Result<Cache<'a, Repo, WriteAs<'b, Signer>, Store<Write>>, Error>
pub fn patches_mut<'a, 'b, Repo, Signer>( &self, repository: &'a Repo, signer: &'b Signer, ) -> Result<Cache<'a, Repo, WriteAs<'b, Signer>, Store<Write>>, Error>
Return a read-write handle for the patches cache.
Trait Implementations§
Source§impl AliasStore for Profile
impl AliasStore for Profile
Auto Trait Implementations§
impl Freeze for Profile
impl RefUnwindSafe for Profile
impl Send for Profile
impl Sync for Profile
impl Unpin for Profile
impl UnsafeUnpin for Profile
impl UnwindSafe for Profile
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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