Struct SysrootLock

Source
pub struct SysrootLock {
    pub sysroot: Sysroot,
    /* private fields */
}
Expand description

A locked system root.

Fields§

§sysroot: Sysroot

The underlying sysroot value.

Implementations§

Source§

impl SysrootLock

Source

pub async fn new_from_sysroot(sysroot: &Sysroot) -> Result<Self>

Asynchronously acquire a sysroot lock. If the lock cannot be acquired immediately, a status message will be printed to standard output. The lock will be unlocked when this object is dropped.

Source

pub fn from_assumed_locked(sysroot: &Sysroot) -> Self

This function should only be used when you have locked the sysroot externally (e.g. in C/C++ code). This also does not unlock on drop.

Methods from Deref<Target = Sysroot>§

Source

pub fn cleanup( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>

Source

pub fn deploy_tree( &self, osname: Option<&str>, revision: &str, origin: Option<&KeyFile>, provided_merge_deployment: Option<&Deployment>, override_kernel_argv: &[&str], cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<Deployment, Error>

Available on crate feature v2018_5 only.
Source

pub fn deploy_tree_with_options( &self, osname: Option<&str>, revision: &str, origin: Option<&KeyFile>, provided_merge_deployment: Option<&Deployment>, opts: Option<&SysrootDeployTreeOpts<'_>>, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<Deployment, Error>

Available on crate feature v2020_7 only.
Source

pub fn deployment_set_kargs( &self, deployment: &Deployment, new_kargs: &[&str], cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>

Source

pub fn deployment_set_kargs_in_place( &self, deployment: &Deployment, kargs_str: Option<&str>, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>

Source

pub fn deployment_set_mutable( &self, deployment: &Deployment, is_mutable: bool, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>

Source

pub fn deployment_set_pinned( &self, deployment: &Deployment, is_pinned: bool, ) -> Result<(), Error>

Available on crate feature v2018_3 only.
Source

pub fn deployment_unlock( &self, deployment: &Deployment, unlocked_state: DeploymentUnlockedState, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>

Available on crate feature v2016_4 only.
Source

pub fn ensure_initialized( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>

Source

pub fn booted_deployment(&self) -> Option<Deployment>

Source

pub fn bootversion(&self) -> i32

Source

pub fn deployment_directory(&self, deployment: &Deployment) -> File

Source

pub fn deployment_dirpath(&self, deployment: &Deployment) -> GString

Source

pub fn deployments(&self) -> Vec<Deployment>

Source

pub fn fd(&self) -> i32

Source

pub fn merge_deployment(&self, osname: Option<&str>) -> Option<Deployment>

Source

pub fn path(&self) -> File

Source

pub fn staged_deployment(&self) -> Option<Deployment>

Available on crate feature v2018_5 only.
Source

pub fn subbootversion(&self) -> i32

Source

pub fn init_osname( &self, osname: &str, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>

Available on crate feature v2016_4 only.
Source

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

Available on crate feature v2020_1 only.
Source

pub fn initialize_with_mount_namespace( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>

Available on crate feature v2022_7 only.
Source

pub fn is_booted(&self) -> bool

Available on crate feature v2020_1 only.
Source

pub fn load( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>

Source

pub fn load_if_changed( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<bool, Error>

Available on crate feature v2016_4 only.
Source

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

Source

pub fn lock_async<P>( &self, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
where P: FnOnce(Result<(), Error>) + 'static,

Source

pub fn lock_future(&self) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>

Source

pub fn origin_new_from_refspec(&self, refspec: &str) -> KeyFile

Source

pub fn prepare_cleanup( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>

Source

pub fn query_deployments_for( &self, osname: Option<&str>, ) -> (Option<Deployment>, Option<Deployment>)

Available on crate feature v2017_7 only.
Source

pub fn repo(&self) -> Repo

Available on crate feature v2017_7 only.
Source

pub fn require_booted_deployment(&self) -> Result<Deployment, Error>

Available on crate feature v2021_1 only.
Source

pub fn set_mount_namespace_in_use(&self)

Available on crate feature v2020_1 only.
Source

pub fn simple_write_deployment( &self, osname: Option<&str>, new_deployment: &Deployment, merge_deployment: Option<&Deployment>, flags: SysrootSimpleWriteDeploymentFlags, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>

Source

pub fn stage_overlay_initrd( &self, fd: i32, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<GString, Error>

Available on crate feature v2020_7 only.
Source

pub fn stage_tree( &self, osname: Option<&str>, revision: &str, origin: Option<&KeyFile>, merge_deployment: Option<&Deployment>, override_kernel_argv: &[&str], cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<Deployment, Error>

Available on crate feature v2018_5 only.
Source

pub fn stage_tree_with_options( &self, osname: Option<&str>, revision: &str, origin: Option<&KeyFile>, merge_deployment: Option<&Deployment>, opts: &SysrootDeployTreeOpts<'_>, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<Deployment, Error>

Available on crate feature v2020_7 only.
Source

pub fn try_lock(&self) -> Result<bool, Error>

Source

pub fn unload(&self)

Source

pub fn unlock(&self)

Source

pub fn write_deployments( &self, new_deployments: &[Deployment], cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>

Source

pub fn write_deployments_with_options( &self, new_deployments: &[Deployment], opts: &SysrootWriteDeploymentsOpts, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>

Available on crate feature v2017_4 only.
Source

pub fn write_origin_file( &self, deployment: &Deployment, new_origin: Option<&KeyFile>, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>

Source

pub fn connect_journal_msg<F>(&self, f: F) -> SignalHandlerId
where F: Fn(&Sysroot, &str) + Send + 'static,

Available on crate feature v2017_10 only.

Trait Implementations§

Source§

impl Debug for SysrootLock

Source§

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

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

impl Deref for SysrootLock

Source§

type Target = Sysroot

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl Drop for SysrootLock

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more