Struct paralegal_spdg::SPDG

source ·
pub struct SPDG {
    pub name: Identifier,
    pub path: Box<[Identifier]>,
    pub id: Endpoint,
    pub graph: SPDGImpl,
    pub markers: HashMap<Node, Box<[Identifier]>>,
    pub arguments: Box<[Node]>,
    pub return_: Box<[Node]>,
    pub type_assigns: HashMap<Node, Types>,
    pub statistics: SPDGStats,
}
Expand description

A semantic PDG, e.g. a graph plus marker annotations

Fields§

§name: Identifier

The identifier of the entry point to this computation

§path: Box<[Identifier]>

The module path to this controller function

§id: Endpoint

The id

§graph: SPDGImpl

The PDG

§markers: HashMap<Node, Box<[Identifier]>>

Nodes to which markers are assigned.

§arguments: Box<[Node]>

The nodes that represent arguments to the entrypoint

§return_: Box<[Node]>

If the return is () or ! then this is None

§type_assigns: HashMap<Node, Types>

Stores the assignment of relevant (e.g. marked) types to nodes. Node that this contains multiple types for a single node, because it hold top-level types and subtypes that may be marked.

§statistics: SPDGStats

Statistics

Implementations§

source§

impl SPDG

source

pub fn node_info(&self, node: Node) -> &NodeInfo

Retrieve metadata for this node

source

pub fn data_sinks(&self) -> impl Iterator<Item = Node> + '_

Returns an iterator over all the data sinks in the data_flow relation.

source

pub fn edges(&self) -> impl Iterator<Item = EdgeReference<'_, EdgeInfo>> + '_

An iterator over all edges in this graph.

source

pub fn all_sources(&self) -> impl Iterator<Item = Node> + '_

Gather all Nodes that are mentioned in this controller including data and control flow.

source

pub fn dump_dot(&self, out: impl Write) -> Result<()>

Dump this graph in dot format.

source

pub fn arguments(&self) -> NodeCluster

The arguments of this spdg. The same as the arguments field, but conveniently paired with the controller id

source

pub fn node_types(&self, node: Node) -> &[TypeId]

All types (if any) assigned to this node

Trait Implementations§

source§

impl Clone for SPDG

source§

fn clone(&self) -> SPDG

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for SPDG

source§

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

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for SPDG

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for SPDG

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for SPDG

§

impl Send for SPDG

§

impl Sync for SPDG

§

impl Unpin for SPDG

§

impl UnwindSafe for SPDG

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,