pub struct Distrobox { /* private fields */ }
Implementations§
Source§impl Distrobox
impl Distrobox
Sourcepub fn new(name: Option<String>) -> Result<Self, NewDistroboxError>
pub fn new(name: Option<String>) -> Result<Self, NewDistroboxError>
Start a Distrobox container with a given name.
Checks if the distrobox container exists and starts it, if necessary. If None
is given as
name, will fall back to the default distrobox name and start that instead. Returns an error
if unsuccessful.
Sourcepub fn start(&self) -> Result<(), StartDistroboxError>
pub fn start(&self) -> Result<(), StartDistroboxError>
Starts a given distrobox container.
This function is automatically called by new()
above and should only ever be called when
creating a Distrobox
object without using the constructor. This is currently the case
when executing aliases in cnf
, as the Distrobox
instance is deserialized from the
config in that case.
Sourcepub fn current() -> Result<Self, CurrentDistroboxError>
pub fn current() -> Result<Self, CurrentDistroboxError>
Get the Toolbx container currently executing CNF.
Will return an error if the current execution environment isn’t Toolbx.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Distrobox
impl<'de> Deserialize<'de> for Distrobox
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Distrobox> for Environment
impl From<Distrobox> for Environment
Source§impl IsEnvironment for Distrobox
impl IsEnvironment for Distrobox
Source§impl Ord for Distrobox
impl Ord for Distrobox
Source§impl PartialOrd for Distrobox
impl PartialOrd for Distrobox
impl Eq for Distrobox
impl StructuralPartialEq for Distrobox
Auto Trait Implementations§
impl Freeze for Distrobox
impl RefUnwindSafe for Distrobox
impl Send for Distrobox
impl Sync for Distrobox
impl Unpin for Distrobox
impl UnwindSafe for Distrobox
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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