[][src]Struct metrix::instruments::switches::Flag

pub struct Flag { /* fields omitted */ }

A Flag which can have the states true or false

The Flag reacts on observations with values. A value of 0 sets the Flag to false, '1' will set the Flag to true. For all other values the behaviour is undefined.

Methods

impl Flag[src]

pub fn new_with_defaults<T: Into<String>>(
    name: T,
    initial_state: Option<bool>
) -> Self
[src]

pub fn name(&self) -> &str[src]

Gets the name of this Flag

pub fn set_name<T: Into<String>>(&mut self, name: T)[src]

Set the name if this Flag.

The name is a path segment within a Snapshot

pub fn set_title<T: Into<String>>(&mut self, title: T)[src]

Sets the title of this Flag.

A title can be part of a descriptive Snapshot

pub fn set_description<T: Into<String>>(&mut self, description: T)[src]

Sets the description of this Flag.

A description can be part of a descriptive Snapshot

pub fn show_inverted(&mut self, name_alternation: NameAlternation)[src]

Show the inverted value. Name will be adjusted with name_alternation.

pub fn show_inverted_prefixed<T: Into<String>>(&mut self, prefix: T)[src]

Show the inverted value. Name will be prefixed with prefix.

pub fn show_inverted_postfixed<T: Into<String>>(&mut self, postfix: T)[src]

Show the inverted value. Name will be postfixed with postfix.

pub fn show_inverted_renamed<T: Into<String>>(&mut self, new_name: T)[src]

Show the inverted value. Name will be renamed with new_name.

pub fn state(&self) -> Option<bool>[src]

Returns the current state

Trait Implementations

impl Updates for Flag[src]

impl Instrument for Flag[src]

impl Descriptive for Flag[src]

impl PutsSnapshot for Flag[src]

Auto Trait Implementations

impl Send for Flag

impl Sync for Flag

impl Unpin for Flag

impl UnwindSafe for Flag

impl RefUnwindSafe for Flag

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,