Struct ActionGroup

Source
#[repr(C)]
pub struct ActionGroup { /* private fields */ }
Expand description

An action group is a group of actions that are currently being performed.

While an active group is active, certain routine clean-up actions that would normally be performed after every cache operation are delayed until the action group is completed. This is necessary primarily to avoid inefficiencies when modifying a large number of packages at once.

This struct represents an active action group. Creating an instance will create an action group; destroying one will destroy the corresponding action group.

The following operations are suppressed by this class:

  • Keeping the Marked and Garbage flags up to date.

Here is an example of creating and releasing an ActionGroup.

use rust_apt::new_cache;

let cache = new_cache!().unwrap();
let mut action_group = unsafe { cache.depcache().action_group() };

// The C++ deconstructor will be run when the action group leaves scope.
// You can also call it explicitly.
action_group.pin_mut().release();

Implementations§

Source§

impl ActionGroup

Source

pub fn release(self: Pin<&mut Self>)

This will release the ActionGroup which will trigger a MarkAndSweep

Trait Implementations§

Source§

impl ExternType for ActionGroup

Source§

type Kind = Opaque

Source§

type Id

A type-level representation of the type’s C++ namespace and type name. Read more
Source§

impl UniquePtrTarget for ActionGroup

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, 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<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.