Skip to main content

InfinityView

Struct InfinityView 

Source
pub struct InfinityView<'a> { /* private fields */ }
Expand description

A validated, borrow-only module view.

Implementations§

Source§

impl<'a> InfinityView<'a>

Source

pub fn new(buf: &'a [u8], limits: Limits) -> Result<Self>

Validate buf and borrow it.

Source

pub fn with_opts(buf: &'a [u8], opts: DecodeOpts) -> Result<Self>

Validate buf and borrow it, with full option control.

Source

pub fn from_validated(validated: Validated<'a>) -> Self

Borrow an image that was already validated.

Source

pub fn validated(&self) -> &Validated<'a>

Source

pub fn buf(&self) -> &'a [u8] ⓘ

Source

pub fn meta(&self) -> Meta

Source

pub fn content_hash(&self) -> [u8; 32]

Source

pub fn content_hash_hex(&self) -> String

Source

pub fn node_count(&self) -> u32

Source

pub fn root(&self) -> Result<Option<NodeId>>

Source

pub fn bindings(&self) -> Result<Vec<(&'a str, NodeId)>>

Source

pub fn annotations(&self) -> Result<Vec<(NodeId, u32, u32)>>

Source

pub fn provenance(&self) -> Result<Option<Provenance>>

Source

pub fn node(&self, id: NodeId) -> Result<NodeView>

Read a node record.

Source

pub fn string(&self, id: u32) -> Result<&'a str>

Borrow string id from the image (zero copy).

Source

pub fn blob(&self, id: u32) -> Result<&'a [u8]>

Borrow blob payload id from the image (zero copy).

Source

pub fn node_string_id(&self, id: NodeId) -> Result<Option<u32>>

The string id a node points at, for the string-bearing scalar kinds.

Source

pub fn primary_string(&self, id: NodeId) -> Result<Option<&'a str>>

Borrow the primary string of a string-bearing node (zero copy).

Source

pub fn children(&self, id: NodeId) -> Result<Vec<NodeId>>

Child ids of a container node, in stored order.

Source

pub fn fields(&self, id: NodeId) -> Result<Vec<(&'a str, NodeId)>>

Table fields of a table node, borrowing names from the image.

Source

pub fn dependents(&self, id: NodeId) -> Result<Vec<NodeId>>

Derived dependents of a node (nodes that reference it), sorted.

Source

pub fn dependencies(&self, id: NodeId) -> Result<Vec<NodeId>>

Derived dependencies of a node (nodes it references), sorted.

Source

pub fn edges(&self) -> Result<Vec<(NodeId, NodeId)>>

All edges, as (dependency, dependent).

Source

pub fn provenance_entries(&self) -> Result<Vec<(String, ProvEntry)>>

Provenance entries, borrowed.

Trait Implementations§

Source§

impl<'a> Clone for InfinityView<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for InfinityView<'a>

Source§

impl<'a> Debug for InfinityView<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.