Struct protobuf::SingularField [] [src]

pub struct SingularField<T> { /* fields omitted */ }

Like Option<T>, but keeps the actual element on clear.

Methods

impl<T> SingularField<T>
[src]

[src]

Construct this object from given value.

[src]

True iff this object contains data.

[src]

True iff this object contains no data.

[src]

Convert this object into Option.

[src]

View data as Option.

[src]

View data as mutable Option.

[src]

Unwrap data as reference.

[src]

Unwrap data as mutable reference.

[src]

Unwrap data, panic if not set.

[src]

Unwrap data or return given default value.

[src]

Unwrap data or return given default value.

[src]

Apply a function to contained element and store result in new SingularPtrField.

[src]

View as iterator over references.

[src]

View as iterator over mutable references.

[src]

Clear this object. Note, contained object destructor is not called, so allocated memory could be reused.

impl<T: Default> SingularField<T>
[src]

[src]

Construct a SingularField with no data.

[src]

Construct SingularField from Option.

[src]

Return data as option, clear this object.

impl<T: Default + Clear> SingularField<T>
[src]

[src]

Get contained data, consume self. Return default value for type if this is empty.

[src]

Initialize this object with default value. This operation can be more efficient then construction of clear element, because it may reuse previously contained object.

Trait Implementations

impl<T: Default> Default for SingularField<T>
[src]

[src]

Returns the "default value" for a type. Read more

impl<T: Clone + Default> Clone for SingularField<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Debug> Debug for SingularField<T>
[src]

[src]

Formats the value using the given formatter. Read more

impl<T: PartialEq> PartialEq for SingularField<T>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl<T: Eq> Eq for SingularField<T>
[src]

impl<T: Hash> Hash for SingularField<T>
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<'a, T> IntoIterator for &'a SingularField<T>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

Creates an iterator from a value. Read more

Auto Trait Implementations

impl<T> Send for SingularField<T> where
    T: Send

impl<T> Sync for SingularField<T> where
    T: Sync