pub struct Defaults { /* private fields */ }Expand description
Defaults configuration for inventory.
Schema: same fields as Group, minus groups and defaults.
This allows defaults to define connection details and data that apply broadly
without nesting or self-references.
Implementations§
Source§impl Defaults
impl Defaults
pub fn builder() -> DefaultsBuilder
Sourcepub fn to_builder(&self) -> DefaultsBuilder
pub fn to_builder(&self) -> DefaultsBuilder
Converts this Defaults instance into a builder for modification.
This method creates a new DefaultsBuilder initialized with all the current
values from this Defaults instance. This is useful when you need to create
a modified copy of existing defaults while preserving most of the original
configuration.
§Returns
Returns a DefaultsBuilder with all fields initialized to match the current
Defaults instance. The builder can then be used to modify specific fields
before calling build() to create a new Defaults instance.
§Examples
let defaults = Defaults::builder()
.username("admin")
.port(22)
.build();
let modified = defaults.to_builder()
.port(2222)
.build();
assert_eq!(modified.port(), Some(2222));
assert_eq!(modified.username(), Some("admin"));pub fn new() -> Self
pub fn hostname(&self) -> Option<&str>
pub fn port(&self) -> Option<u16>
pub fn username(&self) -> Option<&str>
pub fn password(&self) -> Option<&str>
pub fn platform(&self) -> Option<&str>
pub fn data(&self) -> Option<&Data>
pub fn connection_options(&self) -> Option<&CustomTreeMap<ConnectionOptions>>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Defaults
impl<'de> Deserialize<'de> for Defaults
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for Defaults
impl JsonSchema for Defaults
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for Defaults
Auto Trait Implementations§
impl Freeze for Defaults
impl RefUnwindSafe for Defaults
impl Send for Defaults
impl Sync for Defaults
impl Unpin for Defaults
impl UnsafeUnpin for Defaults
impl UnwindSafe for Defaults
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