pub struct SysrootLock {
pub sysroot: Sysroot,
unowned: bool,
}Expand description
A locked system root.
Fields§
§sysroot: SysrootThe underlying sysroot value.
unowned: boolTrue if we didn’t actually lock
Implementations§
Source§impl SysrootLock
impl SysrootLock
Sourcepub async fn new_from_sysroot(sysroot: &Sysroot) -> Result<Self>
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.
Sourcepub fn from_assumed_locked(sysroot: &Sysroot) -> Self
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.
Sourcepub fn change_finalization(&self, deployment: &Deployment) -> Result<()>
pub fn change_finalization(&self, deployment: &Deployment) -> Result<()>
Toggle the finalization lock state of a staged deployment. If the deployment is currently locked, it will be unlocked, and vice versa. The deployment must be a staged deployment.
Methods from Deref<Target = Sysroot>§
pub fn change_finalization(&self, deployment: &Deployment) -> Result<(), Error>
pub fn cleanup( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
pub fn clear_soft_reboot( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
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>
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>
pub fn deployment_can_soft_reboot(&self, deployment: &Deployment) -> bool
pub fn deployment_kexec_load( &self, deployment: &Deployment, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
pub fn deployment_set_kargs( &self, deployment: &Deployment, new_kargs: &[&str], cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
pub fn deployment_set_kargs_in_place( &self, deployment: &Deployment, kargs_str: Option<&str>, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
pub fn deployment_set_mutable( &self, deployment: &Deployment, is_mutable: bool, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
pub fn deployment_set_pinned( &self, deployment: &Deployment, is_pinned: bool, ) -> Result<(), Error>
pub fn deployment_set_soft_reboot( &self, deployment: &Deployment, allow_kernel_skew: bool, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
pub fn deployment_unlock( &self, deployment: &Deployment, unlocked_state: DeploymentUnlockedState, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
pub fn ensure_initialized( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
pub fn booted_deployment(&self) -> Option<Deployment>
pub fn bootversion(&self) -> i32
pub fn deployment_directory(&self, deployment: &Deployment) -> File
pub fn deployment_dirpath(&self, deployment: &Deployment) -> GString
pub fn deployments(&self) -> Vec<Deployment>
pub fn fd(&self) -> i32
pub fn merge_deployment(&self, osname: Option<&str>) -> Option<Deployment>
pub fn path(&self) -> File
pub fn staged_deployment(&self) -> Option<Deployment>
pub fn subbootversion(&self) -> i32
pub fn init_osname( &self, osname: &str, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
pub fn initialize(&self) -> Result<(), Error>
pub fn initialize_with_mount_namespace( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
pub fn is_booted(&self) -> bool
pub fn load( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
pub fn load_if_changed( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<bool, Error>
pub fn lock(&self) -> Result<(), Error>
pub fn lock_async<P>( &self, cancellable: Option<&impl IsA<Cancellable>>, callback: P, )
pub fn lock_future(&self) -> Pin<Box<dyn Future<Output = Result<(), Error>>>>
pub fn origin_new_from_refspec(&self, refspec: &str) -> KeyFile
pub fn prepare_cleanup( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
pub fn query_deployments_for( &self, osname: Option<&str>, ) -> (Option<Deployment>, Option<Deployment>)
pub fn repo(&self) -> Repo
pub fn require_booted_deployment(&self) -> Result<Deployment, Error>
pub fn set_mount_namespace_in_use(&self)
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>
pub fn stage_overlay_initrd( &self, fd: i32, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<GString, Error>
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>
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>
pub fn try_lock(&self) -> Result<bool, Error>
pub fn unload(&self)
pub fn unlock(&self)
pub fn update_post_copy( &self, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
pub fn write_deployments( &self, new_deployments: &[Deployment], cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
pub fn write_deployments_with_options( &self, new_deployments: &[Deployment], opts: &SysrootWriteDeploymentsOpts, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
pub fn write_origin_file( &self, deployment: &Deployment, new_origin: Option<&KeyFile>, cancellable: Option<&impl IsA<Cancellable>>, ) -> Result<(), Error>
pub fn connect_journal_msg<F>(&self, f: F) -> SignalHandlerId
pub fn dfd_borrow(&self) -> BorrowedFd<'_>
pub fn dfd_borrow(&self) -> BorrowedFd<'_>
Borrow the directory file descriptor for this sysroot.
Trait Implementations§
Source§impl Debug for SysrootLock
impl Debug for SysrootLock
Source§impl Deref for SysrootLock
impl Deref for SysrootLock
Auto Trait Implementations§
impl Freeze for SysrootLock
impl RefUnwindSafe for SysrootLock
impl Send for SysrootLock
impl !Sync for SysrootLock
impl Unpin for SysrootLock
impl UnwindSafe for SysrootLock
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
§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§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Set the foreground color generically Read more
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Set the background color generically. Read more
§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Change the background color to magenta
§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Change the foreground color to the terminal default
§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Change the background color to the terminal default
§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Change the foreground color to bright black
§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Change the background color to bright black
§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Change the foreground color to bright red
§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Change the background color to bright red
§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Change the foreground color to bright green
§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Change the background color to bright green
§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Change the foreground color to bright yellow
§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Change the background color to bright yellow
§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Change the foreground color to bright blue
§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Change the background color to bright blue
§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Change the foreground color to bright magenta
§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Change the background color to bright magenta
§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Change the foreground color to bright purple
§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Change the background color to bright purple
§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Change the foreground color to bright cyan
§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Change the background color to bright cyan
§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Change the foreground color to bright white
§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Change the background color to bright white
§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Make the text blink (but fast!)
Hide the text
§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Cross out the text
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
Set the foreground color at runtime. Only use if you do not know which color will be used at
compile-time. If the color is constant, use either [
OwoColorize::fg] or
a color-specific method, such as [OwoColorize::green], Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
Set the background color at runtime. Only use if you do not know what color to use at
compile-time. If the color is constant, use either [
OwoColorize::bg] or
a color-specific method, such as [OwoColorize::on_yellow], Read more§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
Set the foreground color to a specific RGB value.
§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
Set the background color to a specific RGB value.
§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
Sets the foreground color to an RGB value.
§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
Sets the background color to an RGB value.