pub struct StructView<'a>(/* private fields */);Expand description
A struct value’s name and fields.
Implementations§
Source§impl<'a> StructView<'a>
impl<'a> StructView<'a>
Sourcepub fn type_name(self) -> &'a str
pub fn type_name(self) -> &'a str
The qualified name of the declared type, such as
rules.policy.PullRequest — the name Value::structure takes.
Sourcepub fn field(self, name: &str) -> Option<&'a Value>
pub fn field(self, name: &str) -> Option<&'a Value>
The field name, or None when the struct declares no such field.
Sourcepub fn fields(self) -> impl Iterator<Item = (&'a str, &'a Value)>
pub fn fields(self) -> impl Iterator<Item = (&'a str, &'a Value)>
The fields, in declaration order.
Sourcepub fn is_opaque(self) -> bool
pub fn is_opaque(self) -> bool
Whether the declaration said export opaque struct (ADR 0014), which
governs how the value renders and nothing else.
The fields are readable here whatever this answers, for the reason
Value::fields gives: a host holding the value has already been
handed it.
Trait Implementations§
Source§impl<'a> Clone for StructView<'a>
impl<'a> Clone for StructView<'a>
Source§fn clone(&self) -> StructView<'a>
fn clone(&self) -> StructView<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for StructView<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for StructView<'a>
impl<'a> !Send for StructView<'a>
impl<'a> !Sync for StructView<'a>
impl<'a> !UnwindSafe for StructView<'a>
impl<'a> Freeze for StructView<'a>
impl<'a> Unpin for StructView<'a>
impl<'a> UnsafeUnpin for StructView<'a>
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