pub struct InfinityView<'a> { /* private fields */ }Expand description
A validated, borrow-only module view.
Implementations§
Source§impl<'a> InfinityView<'a>
impl<'a> InfinityView<'a>
Sourcepub fn with_opts(buf: &'a [u8], opts: DecodeOpts) -> Result<Self>
pub fn with_opts(buf: &'a [u8], opts: DecodeOpts) -> Result<Self>
Validate buf and borrow it, with full option control.
Sourcepub fn from_validated(validated: Validated<'a>) -> Self
pub fn from_validated(validated: Validated<'a>) -> Self
Borrow an image that was already validated.
pub fn validated(&self) -> &Validated<'a>
pub fn buf(&self) -> &'a [u8] ⓘ
pub fn meta(&self) -> Meta
pub fn content_hash(&self) -> [u8; 32]
pub fn content_hash_hex(&self) -> String
pub fn node_count(&self) -> u32
pub fn root(&self) -> Result<Option<NodeId>>
pub fn bindings(&self) -> Result<Vec<(&'a str, NodeId)>>
pub fn annotations(&self) -> Result<Vec<(NodeId, u32, u32)>>
pub fn provenance(&self) -> Result<Option<Provenance>>
Sourcepub fn blob(&self, id: u32) -> Result<&'a [u8]>
pub fn blob(&self, id: u32) -> Result<&'a [u8]>
Borrow blob payload id from the image (zero copy).
Sourcepub fn node_string_id(&self, id: NodeId) -> Result<Option<u32>>
pub fn node_string_id(&self, id: NodeId) -> Result<Option<u32>>
The string id a node points at, for the string-bearing scalar kinds.
Sourcepub fn primary_string(&self, id: NodeId) -> Result<Option<&'a str>>
pub fn primary_string(&self, id: NodeId) -> Result<Option<&'a str>>
Borrow the primary string of a string-bearing node (zero copy).
Sourcepub fn children(&self, id: NodeId) -> Result<Vec<NodeId>>
pub fn children(&self, id: NodeId) -> Result<Vec<NodeId>>
Child ids of a container node, in stored order.
Sourcepub fn fields(&self, id: NodeId) -> Result<Vec<(&'a str, NodeId)>>
pub fn fields(&self, id: NodeId) -> Result<Vec<(&'a str, NodeId)>>
Table fields of a table node, borrowing names from the image.
Sourcepub fn dependents(&self, id: NodeId) -> Result<Vec<NodeId>>
pub fn dependents(&self, id: NodeId) -> Result<Vec<NodeId>>
Derived dependents of a node (nodes that reference it), sorted.
Trait Implementations§
Source§impl<'a> Clone for InfinityView<'a>
impl<'a> Clone for InfinityView<'a>
impl<'a> Copy for InfinityView<'a>
Auto Trait Implementations§
impl<'a> Freeze for InfinityView<'a>
impl<'a> RefUnwindSafe for InfinityView<'a>
impl<'a> Send for InfinityView<'a>
impl<'a> Sync for InfinityView<'a>
impl<'a> Unpin for InfinityView<'a>
impl<'a> UnsafeUnpin for InfinityView<'a>
impl<'a> UnwindSafe for InfinityView<'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