Struct protobuf::SingularPtrField [] [src]

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

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

Methods

impl<T> SingularPtrField<T>
[src]

[src]

Construct SingularPtrField from given object.

[src]

Construct an empty SingularPtrField.

[src]

Construct SingularPtrField from optional.

[src]

True iff this object contains data.

[src]

True iff this object contains no data.

[src]

Convert into Option<T>.

[src]

View data as reference option.

[src]

View data as mutable reference option.

[src]

Get data as reference. Panics if empty.

[src]

Get data as mutable reference. Panics if empty.

[src]

Take the data. Panics if empty

[src]

Take the data or return supplied default element if empty.

[src]

Take the data or return supplied default element if empty.

[src]

Apply given function to contained data to construct another SingularPtrField. Returns empty SingularPtrField if this object is empty.

[src]

View data as iterator.

[src]

View data as mutable iterator.

[src]

Take data as option, leaving this object empty.

[src]

Clear this object, but do not call destructor of underlying data.

impl<T: Default + Clear> SingularPtrField<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 for SingularPtrField<T>
[src]

[src]

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

impl<T: Clone> Clone for SingularPtrField<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 SingularPtrField<T>
[src]

[src]

Formats the value using the given formatter. Read more

impl<T: PartialEq> PartialEq for SingularPtrField<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 SingularPtrField<T>
[src]

impl<T: Hash> Hash for SingularPtrField<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 SingularPtrField<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 SingularPtrField<T> where
    T: Send

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