pub struct ResourceUpdate {
pub vcpus: Option<u32>,
pub memory_mb: Option<u32>,
pub limits: ResourceLimits,
}Expand description
A resource update request.
Fields set to None are left unchanged.
Fields§
§vcpus: Option<u32>vCPU count change (Tier 1 — will be rejected).
memory_mb: Option<u32>Memory in MiB change (Tier 1 — will be rejected).
limits: ResourceLimitsCgroup-based limits (Tier 2 — applied via exec).
Implementations§
Source§impl ResourceUpdate
impl ResourceUpdate
Sourcepub fn has_tier1_changes(&self) -> bool
pub fn has_tier1_changes(&self) -> bool
Check if any Tier 1 (immutable) fields are requested.
Sourcepub fn has_tier2_changes(&self) -> bool
pub fn has_tier2_changes(&self) -> bool
Check if any Tier 2 (cgroup) fields are requested.
Sourcepub fn build_cgroup_commands(&self) -> Vec<String>
pub fn build_cgroup_commands(&self) -> Vec<String>
Build shell commands to apply Tier 2 cgroup changes inside the guest.
Returns one sh command per cgroup v2 control file. The resize exec runs
in the guest ROOT cgroup, so each command resolves the per-container
cgroup slice (box-<pid>-<seq>, joined by the container at spawn) at
runtime and writes there — a bare /sys/fs/cgroup/<file> write would hit
the root cgroup and silently leave the container’s limits unchanged.
Trait Implementations§
Source§impl Clone for ResourceUpdate
impl Clone for ResourceUpdate
Source§fn clone(&self) -> ResourceUpdate
fn clone(&self) -> ResourceUpdate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResourceUpdate
impl Debug for ResourceUpdate
Source§impl Default for ResourceUpdate
impl Default for ResourceUpdate
Source§fn default() -> ResourceUpdate
fn default() -> ResourceUpdate
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ResourceUpdate
impl RefUnwindSafe for ResourceUpdate
impl Send for ResourceUpdate
impl Sync for ResourceUpdate
impl Unpin for ResourceUpdate
impl UnsafeUnpin for ResourceUpdate
impl UnwindSafe for ResourceUpdate
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
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