pub struct VariableBuilder { /* private fields */ }Expand description
Builder for Variable objects, used to simplify the creation of new instances.
§Example
use opsview::config::Variable;
use opsview::prelude::*;
let variable = Variable::builder()
.name("MY_VARIABLE")
.value("my_value")
.build()
.unwrap();
assert_eq!(variable.name, "MY_VARIABLE".to_string());
assert_eq!(variable.value, Some("my_value".to_string()));Implementations§
Source§impl VariableBuilder
impl VariableBuilder
Sourcepub fn clear_arg1(self) -> Self
pub fn clear_arg1(self) -> Self
Clears the arg1 field.
Sourcepub fn clear_arg2(self) -> Self
pub fn clear_arg2(self) -> Self
Clears the arg2 field.
Sourcepub fn clear_arg3(self) -> Self
pub fn clear_arg3(self) -> Self
Clears the arg3 field.
Sourcepub fn clear_arg4(self) -> Self
pub fn clear_arg4(self) -> Self
Clears the arg4 field.
Sourcepub fn clear_label1(self) -> Self
pub fn clear_label1(self) -> Self
Clears the label1 field.
Sourcepub fn clear_label2(self) -> Self
pub fn clear_label2(self) -> Self
Clears the label2 field.
Sourcepub fn clear_label3(self) -> Self
pub fn clear_label3(self) -> Self
Clears the label3 field.
Sourcepub fn clear_label4(self) -> Self
pub fn clear_label4(self) -> Self
Clears the label4 field.
Sourcepub fn clear_name(self) -> Self
pub fn clear_name(self) -> Self
Clears the name field.
Sourcepub fn clear_secured1(self) -> Self
pub fn clear_secured1(self) -> Self
Clears the secured1 field.
Sourcepub fn clear_secured2(self) -> Self
pub fn clear_secured2(self) -> Self
Clears the secured2 field.
Sourcepub fn clear_secured3(self) -> Self
pub fn clear_secured3(self) -> Self
Clears the secured3 field.
Sourcepub fn clear_secured4(self) -> Self
pub fn clear_secured4(self) -> Self
Clears the secured4 field.
Sourcepub fn clear_value(self) -> Self
pub fn clear_value(self) -> Self
Clears the value field.
Sourcepub fn secured1(self, secured1: bool) -> Self
pub fn secured1(self, secured1: bool) -> Self
Sets the secured1 field.
§Arguments
secured1- A boolean indicating whether or notarg1should be secured.
Sourcepub fn secured2(self, secured2: bool) -> Self
pub fn secured2(self, secured2: bool) -> Self
Sets the secured2 field.
§Arguments
secured2- A boolean indicating whether or notarg2should be secured.
Sourcepub fn secured3(self, secured3: bool) -> Self
pub fn secured3(self, secured3: bool) -> Self
Sets the secured3 field.
§Arguments
secured3- A boolean indicating whether or notarg3should be secured.
Trait Implementations§
Source§impl Builder for VariableBuilder
impl Builder for VariableBuilder
Source§fn new() -> Self
fn new() -> Self
Creates a new VariableBuilder instance used to construct a Variable object.
§Returns
A VariableBuilder instance.
Source§fn build(self) -> Result<Self::ConfigObject, OpsviewConfigError>
fn build(self) -> Result<Self::ConfigObject, OpsviewConfigError>
Builds a new Variable instance using the VariableBuilder.
§Returns
A Variable instance.
§Errors
namenot set or invalid.
type ConfigObject = Variable
Source§impl Clone for VariableBuilder
impl Clone for VariableBuilder
Source§fn clone(&self) -> VariableBuilder
fn clone(&self) -> VariableBuilder
Returns a duplicate of the value. Read more
1.0.0 · 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 VariableBuilder
impl Debug for VariableBuilder
Auto Trait Implementations§
impl Freeze for VariableBuilder
impl RefUnwindSafe for VariableBuilder
impl Send for VariableBuilder
impl Sync for VariableBuilder
impl Unpin for VariableBuilder
impl UnwindSafe for VariableBuilder
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