paralegal_spdg

Struct 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 Freeze for SPDG

§

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 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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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 = 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 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.
Source§

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