Struct protobuf::SingularField [−][src]
pub struct SingularField<T> { /* fields omitted */ }
Expand description
Like Option<T>
, but keeps the actual element on clear
.
Implementations
Construct this object from given value.
Convert this object into Option
.
Unwrap data as reference.
Unwrap data as mutable reference.
Unwrap data or return given default value.
Apply a function to contained element and store result in new SingularPtrField
.
View as iterator over mutable references.
Construct a SingularField
with no data.
Construct SingularField
from Option
.
Get contained data, consume self. Return default value for type if this is empty.
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
Returns the “default value” for a type. Read more
fn deserialize<D>(
deserializer: D
) -> Result<Self, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<Self, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for SingularField<T> where
T: RefUnwindSafe,
impl<T> Send for SingularField<T> where
T: Send,
impl<T> Sync for SingularField<T> where
T: Sync,
impl<T> Unpin for SingularField<T> where
T: Unpin,
impl<T> UnwindSafe for SingularField<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more