#[non_exhaustive]pub struct DataItem {
pub data_item: Option<DataItem>,
/* private fields */
}Expand description
Represents Data item
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.data_item: Option<DataItem>Either of text or bytes data.
Implementations§
Source§impl DataItem
impl DataItem
pub fn new() -> Self
Sourcepub fn set_data_item<T: Into<Option<DataItem>>>(self, v: T) -> Self
pub fn set_data_item<T: Into<Option<DataItem>>>(self, v: T) -> Self
Sets the value of data_item.
Note that all the setters affecting data_item are mutually
exclusive.
Sourcepub fn text(&self) -> Option<&String>
pub fn text(&self) -> Option<&String>
The value of data_item
if it holds a Text, None if the field is not set or
holds a different branch.
Sourcepub fn set_text<T: Into<String>>(self, v: T) -> Self
pub fn set_text<T: Into<String>>(self, v: T) -> Self
Sets the value of data_item
to hold a Text.
Note that all the setters affecting data_item are
mutually exclusive.
Sourcepub fn byte_item(&self) -> Option<&Box<ByteDataItem>>
pub fn byte_item(&self) -> Option<&Box<ByteDataItem>>
The value of data_item
if it holds a ByteItem, None if the field is not set or
holds a different branch.
Sourcepub fn set_byte_item<T: Into<Box<ByteDataItem>>>(self, v: T) -> Self
pub fn set_byte_item<T: Into<Box<ByteDataItem>>>(self, v: T) -> Self
Sets the value of data_item
to hold a ByteItem.
Note that all the setters affecting data_item are
mutually exclusive.
Trait Implementations§
impl StructuralPartialEq for DataItem
Auto Trait Implementations§
impl Freeze for DataItem
impl RefUnwindSafe for DataItem
impl Send for DataItem
impl Sync for DataItem
impl Unpin for DataItem
impl UnwindSafe for DataItem
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