pub struct Context {
pub path: Option<PathBuf>,
pub home: Option<PathBuf>,
pub recursive: bool,
}
Expand description
Project context, manifest, current directory etc All the info that is relevant in most of the commands
Fields§
§path: Option<PathBuf>
Path at which the command is called, None when default
home: Option<PathBuf>
Path to use for the Aleo registry, None when default
recursive: bool
Recursive flag.
Implementations§
Source§impl Context
impl Context
pub fn new( path: Option<PathBuf>, home: Option<PathBuf>, recursive: bool, ) -> Result<Context>
Sourcepub fn parent_dir(&self) -> Result<PathBuf>
pub fn parent_dir(&self) -> Result<PathBuf>
Returns the path of the parent directory to the Leo package.
Sourcepub fn open_manifest(&self) -> Result<Manifest>
pub fn open_manifest(&self) -> Result<Manifest>
Opens the manifest file program.json
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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