Struct sysctl::CtlInfo

source ·
pub struct CtlInfo {
    pub ctl_type: CtlType,
    pub fmt: String,
    pub flags: u32,
}
Expand description

A structure representing control metadata

Fields§

§ctl_type: CtlType

The control type.

§fmt: String

A string which specifies the format of the OID in a symbolic way.

This format is used as a hint by sysctl(8) to apply proper data formatting for display purposes.

Formats defined in sysctl(9):

  • N node
  • A char *
  • I int
  • IK[n] temperature in Kelvin, multiplied by an optional single digit power of ten scaling factor: 1 (default) gives deciKelvin, 0 gives Kelvin, 3 gives milliKelvin
  • IU unsigned int
  • L long
  • LU unsigned long
  • Q quad_t
  • QU u_quad_t
  • S,TYPE struct TYPE structures
§flags: u32

Implementations§

Return the flags for this sysctl.

If the sysctl is a structure, return the structure type string.

Checks whether the format string starts with S, and returns the rest of the format string or None if the format String does not have a struct hint.

Trait Implementations§

Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.