Struct protobuf::SingularPtrField [−][src]
pub struct SingularPtrField<T> { /* fields omitted */ }
Expand description
Like Option<Box<T>>
, but keeps the actual element on clear
.
Implementations
Construct SingularPtrField
from given object.
Construct an empty SingularPtrField
.
Construct SingularPtrField
from optional.
Convert into Option<T>
.
Get data as mutable reference. Panics if empty.
Take the data or return supplied default element if empty.
Apply given function to contained data to construct another SingularPtrField
.
Returns empty SingularPtrField
if this object is empty.
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>,
[src]
fn deserialize<D>(
deserializer: D
) -> Result<Self, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
[src]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,
[src]
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for SingularPtrField<T> where
T: RefUnwindSafe,
impl<T> Send for SingularPtrField<T> where
T: Send,
impl<T> Sync for SingularPtrField<T> where
T: Sync,
impl<T> Unpin for SingularPtrField<T>
impl<T> UnwindSafe for SingularPtrField<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more