pub struct Sysctl { /* private fields */ }Expand description
A key=value sysctl applied to the guest before the scheduler
starts, injected into the guest kernel cmdline as
sysctl.<key>=<value>.
Use the dot-separated form for key (e.g. "kernel.foo", not
"kernel/foo"). Duplicate keys in a scheduler’s sysctls slice are
applied in order; the last write wins.
Construct with Sysctl::new, which const-asserts the key format
at compile time. Direct struct-literal construction is rejected
(fields are crate-private) to ensure every constructed Sysctl
passed through the format gate.
Implementations§
Source§impl Sysctl
impl Sysctl
Sourcepub const fn new(key: &'static str, value: &'static str) -> Self
pub const fn new(key: &'static str, value: &'static str) -> Self
Const constructor for use in static/const context.
§Panics
Panics at compile time (or const-eval time) when:
keyis emptykeycontains/(common typo from sysctl conf-file paths — sysctl-write uses the dotted form, not the slash form)keycontains whitespace,=, or any control byte (would corrupt thesysctl.<key>=<value>cmdline form)keydoes not contain at least one.(sysctls are namespaced likekernel.foo/net.core.bar; a bare single-segment name is almost certainly a typo)keystarts or ends with.keycontains an empty segment (..— kernel sysctl parser rejects)valueis emptyvaluecontains a newline / carriage return /=(would corrupt thesysctl.<key>=<value>cmdline form)
Trait Implementations§
impl Copy for Sysctl
impl Eq for Sysctl
impl StructuralPartialEq for Sysctl
Auto Trait Implementations§
impl Freeze for Sysctl
impl RefUnwindSafe for Sysctl
impl Send for Sysctl
impl Sync for Sysctl
impl Unpin for Sysctl
impl UnwindSafe for Sysctl
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. 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