pub struct Home { /* private fields */ }Expand description
Radicle home.
Implementations§
Source§impl Home
impl Home
Sourcepub fn new(home: impl Into<PathBuf>) -> Result<Home, Error>
pub fn new(home: impl Into<PathBuf>) -> Result<Home, Error>
Creates the Radicle Home directories.
The home path is used as the base directory for all
necessary subdirectories.
If home does not already exist then it and any
subdirectories are created using fs::create_dir_all.
The home path is also canonicalized using fs::canonicalize.
All necessary subdirectories are also created.
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§
Auto Trait Implementations§
impl Freeze for Home
impl RefUnwindSafe for Home
impl Send for Home
impl Sync for Home
impl Unpin for Home
impl UnsafeUnpin for Home
impl UnwindSafe for Home
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