Struct radicle::profile::Profile

source ·
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: Config

Implementations§

source§

impl Profile

source

pub fn init( home: Home, alias: Alias, passphrase: Option<Passphrase>, seed: Seed, ) -> Result<Self, Error>

source

pub fn load() -> Result<Self, Error>

source

pub fn id(&self) -> &PublicKey

source

pub fn info(&self) -> UserInfo

source

pub fn hints(&self) -> bool

source

pub fn did(&self) -> Did

source

pub fn signer(&self) -> Result<Box<dyn Signer>, Error>

source

pub fn home(&self) -> &Home

Get radicle home.

source

pub fn policies(&self) -> Result<Config<Read>, Error>

Return a read-only handle to the policies of the node.

source

pub fn aliases(&self) -> Aliases

Return a multi-source store for aliases.

source

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.

source

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.

source

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.

Methods from Deref<Target = Home>§

source

pub fn path(&self) -> &Path

source

pub fn storage(&self) -> PathBuf

source

pub fn config(&self) -> PathBuf

source

pub fn keys(&self) -> PathBuf

source

pub fn node(&self) -> PathBuf

source

pub fn cobs(&self) -> PathBuf

source

pub fn socket(&self) -> PathBuf

source

pub fn notifications_mut(&self) -> Result<StoreWriter, Error>

Return a read-write handle to the notifications database.

source

pub fn policies_mut(&self) -> Result<StoreWriter, Error>

Return a read-write handle to the policies store of the node.

source

pub fn database(&self) -> Result<Database, Error>

Return a handle to a read-only database of the node.

source

pub fn database_mut(&self) -> Result<Database, Error>

Return a handle to the database of the node.

source

pub fn addresses(&self) -> Result<impl Store, Error>

Returns the address store.

source

pub fn routing(&self) -> Result<impl Store, Error>

Returns the routing store.

source

pub fn routing_mut(&self) -> Result<impl Store, Error>

Returns the routing store, mutably.

source

pub fn issues<'a, R>( &self, repository: &'a R, ) -> Result<Cache<Issues<'a, R>, StoreReader>, Error>
where R: ReadRepository + Store,

Return a read-only handle for the issues cache.

source

pub fn issues_mut<'a, R>( &self, repository: &'a R, ) -> Result<Cache<Issues<'a, R>, StoreWriter>, Error>
where R: ReadRepository + Store,

Return a read-write handle for the issues cache.

source

pub fn patches<'a, R>( &self, repository: &'a R, ) -> Result<Cache<Patches<'a, R>, StoreReader>, Error>
where R: ReadRepository + Store,

Return a read-only handle for the patches cache.

source

pub fn patches_mut<'a, R>( &self, repository: &'a R, ) -> Result<Cache<Patches<'a, R>, StoreWriter>, Error>
where R: ReadRepository + Store,

Return a read-write handle for the patches cache.

Trait Implementations§

source§

impl AliasStore for Profile

source§

fn alias(&self, nid: &NodeId) -> Option<Alias>

Returns alias of a NodeId.
source§

impl Clone for Profile

source§

fn clone(&self) -> Profile

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Profile

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for Profile

source§

type Target = Home

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for Profile

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.