pub struct Part { /* private fields */ }Expand description
One field-complete message part with an open canonical kind.
ⓘ
use reef_core::value::content;
let _forged = content::Part { kind: content::PartKind::from_i64(0), fields: panic!() };Implementations§
Source§impl Part
impl Part
Sourcepub const fn new(kind: PartKind, fields: PartFields) -> Self
pub const fn new(kind: PartKind, fields: PartFields) -> Self
Creates a part without rejecting or dropping cross-kind fields.
Sourcepub const fn text(text: String) -> Self
pub const fn text(text: String) -> Self
Creates ordinary text with every other field empty or absent.
Sourcepub const fn fields(&self) -> &PartFields
pub const fn fields(&self) -> &PartFields
Returns every field as one immutable value.
Sourcepub fn into_parts(self) -> (PartKind, PartFields)
pub fn into_parts(self) -> (PartKind, PartFields)
Transfers the canonical kind and complete field set.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Part
impl<'de> Deserialize<'de> for Part
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Part
impl RefUnwindSafe for Part
impl Send for Part
impl Sync for Part
impl Unpin for Part
impl UnsafeUnpin for Part
impl UnwindSafe for Part
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