pub struct TenancyBuilder { /* private fields */ }Expand description
Builder for Tenancy objects, used to simplify the creation of new instances.
§Example
use opsview::config::{Role, Tenancy};
use opsview::prelude::*;
let my_role = Role::minimal("My Role").unwrap();
let tenancy = Tenancy::builder()
.name("My Tenancy")
.primary_role(my_role)
.build()
.unwrap();
assert_eq!(tenancy.name, "My Tenancy".to_string());Implementations§
Source§impl TenancyBuilder
impl TenancyBuilder
Sourcepub fn clear_name(self) -> Self
pub fn clear_name(self) -> Self
Clears the name field.
Sourcepub fn clear_description(self) -> Self
pub fn clear_description(self) -> Self
Clears the description field.
Sourcepub fn clear_primary_role(self) -> Self
pub fn clear_primary_role(self) -> Self
Clears the primary_role field.
Sourcepub fn description(self, description: &str) -> Self
pub fn description(self, description: &str) -> Self
Sourcepub fn primary_role(self, primary_role: Role) -> Self
pub fn primary_role(self, primary_role: Role) -> Self
Trait Implementations§
Source§impl Builder for TenancyBuilder
impl Builder for TenancyBuilder
Source§impl Clone for TenancyBuilder
impl Clone for TenancyBuilder
Source§fn clone(&self) -> TenancyBuilder
fn clone(&self) -> TenancyBuilder
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 TenancyBuilder
impl Debug for TenancyBuilder
Source§impl Default for TenancyBuilder
impl Default for TenancyBuilder
Source§fn default() -> TenancyBuilder
fn default() -> TenancyBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TenancyBuilder
impl RefUnwindSafe for TenancyBuilder
impl Send for TenancyBuilder
impl Sync for TenancyBuilder
impl Unpin for TenancyBuilder
impl UnwindSafe for TenancyBuilder
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