Struct fidl_next::WireOptionalString
source · pub struct WireOptionalString<'buf> { /* private fields */ }
Expand description
An optional FIDL string
Implementations§
source§impl<'buf> WireOptionalString<'buf>
impl<'buf> WireOptionalString<'buf>
sourcepub fn encode_present(slot: Slot<'_, Self>, len: u64)
pub fn encode_present(slot: Slot<'_, Self>, len: u64)
Encodes that a string is present in a slot.
sourcepub fn encode_absent(slot: Slot<'_, Self>)
pub fn encode_absent(slot: Slot<'_, Self>)
Encodes that a string is absent in a slot.
sourcepub fn take(&mut self) -> Option<WireString<'buf>>
pub fn take(&mut self) -> Option<WireString<'buf>>
Takes the string out of the option, if any.
sourcepub fn as_ref(&self) -> Option<&WireString<'buf>>
pub fn as_ref(&self) -> Option<&WireString<'buf>>
Returns a reference to the underlying string, if any.
sourcepub fn as_mut(&mut self) -> Option<&mut WireString<'buf>>
pub fn as_mut(&mut self) -> Option<&mut WireString<'buf>>
Returns a mutable reference to the underlying string, if any.
Trait Implementations§
source§impl Debug for WireOptionalString<'_>
impl Debug for WireOptionalString<'_>
source§impl<'buf> Default for WireOptionalString<'buf>
impl<'buf> Default for WireOptionalString<'buf>
source§fn default() -> WireOptionalString<'buf>
fn default() -> WireOptionalString<'buf>
Returns the “default value” for a type. Read more
source§impl TakeFrom<WireOptionalString<'_>> for Option<String>
impl TakeFrom<WireOptionalString<'_>> for Option<String>
source§fn take_from(from: &mut WireOptionalString<'_>) -> Self
fn take_from(from: &mut WireOptionalString<'_>) -> Self
Converts from the given
T
, taking any resources that can’t be cloned.Auto Trait Implementations§
impl<'buf> Freeze for WireOptionalString<'buf>
impl<'buf> RefUnwindSafe for WireOptionalString<'buf>
impl<'buf> !Send for WireOptionalString<'buf>
impl<'buf> !Sync for WireOptionalString<'buf>
impl<'buf> Unpin for WireOptionalString<'buf>
impl<'buf> !UnwindSafe for WireOptionalString<'buf>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more