Struct iroh_docs::cli::ConsoleEnv
source · pub struct ConsoleEnv(/* private fields */);
Available on crate feature
cli
only.Expand description
Environment for CLI and REPL
This is cheaply cloneable and has interior mutability. If not running in the console
environment, Self::set_doc
and Self::set_author
will lead to an error, as changing the
environment is only supported within the console.
Implementations§
source§impl ConsoleEnv
impl ConsoleEnv
sourcepub async fn for_console(
iroh_data_dir: PathBuf,
authors: &Client
) -> Result<Self>
pub async fn for_console( iroh_data_dir: PathBuf, authors: &Client ) -> Result<Self>
Read from environment variables and the console config file.
sourcepub async fn for_cli(iroh_data_dir: PathBuf, authors: &Client) -> Result<Self>
pub async fn for_cli(iroh_data_dir: PathBuf, authors: &Client) -> Result<Self>
Read only from environment variables.
sourcepub fn iroh_data_dir(&self) -> PathBuf
pub fn iroh_data_dir(&self) -> PathBuf
Return the iroh data directory
sourcepub fn doc(&self, arg: Option<NamespaceId>) -> Result<NamespaceId>
pub fn doc(&self, arg: Option<NamespaceId>) -> Result<NamespaceId>
Get the active document.
Get the active author.
This is either the node’s default author, or in the console optionally the author manually switched to.
Trait Implementations§
source§impl Clone for ConsoleEnv
impl Clone for ConsoleEnv
source§fn clone(&self) -> ConsoleEnv
fn clone(&self) -> ConsoleEnv
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ConsoleEnv
impl RefUnwindSafe for ConsoleEnv
impl Send for ConsoleEnv
impl Sync for ConsoleEnv
impl Unpin for ConsoleEnv
impl UnwindSafe for ConsoleEnv
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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