Struct BranchResolver

Source
pub struct BranchResolver { /* private fields */ }
Expand description

Handles branch resolution which is more complicated because unnamed branches exist and discipline comparability has to be enforced

§Safety

Branch resolution may only take place after all nets and ports have been folded! UB might occur otherwise.

Implementations§

Source§

impl<'lt> BranchResolver

Source

pub fn new(ast: &'lt Ast) -> Self

Source

pub fn resolve_discipline_access( &mut self, fold: &mut Fold<'lt>, nature_name: &Ident, discipline: DisciplineId, ) -> Option<DisciplineAccess>

Resolves a DisciplineAccess (for example V(b) or V(x,y))

§Arguments
  • fold - The calling fold which is used for name resolution and error handling

  • nature_name - The identifier of the nature (for example V in the case of V(X,Y))

  • discipline - The id of the Discipline of a BranchAccess ( that has been resolved using resolve_branch_access

§Safety

This is only save to call

Source

pub fn resolve_nature_access( fold: &mut Fold<'lt>, id: NatureId, discipline: DisciplineId, ) -> Option<DisciplineAccess>

Source

pub fn resolve_branch_access( &mut self, fold: &mut Fold<'lt>, branch_access: &Node<BranchAccess>, ) -> Option<(BranchId, DisciplineId)>

Resolves a branch access such as (NET1,NET2),(<PORT>) or (BRANCH)

§Arguments
  • fold - The calling fold which is used for name resolution and error handling

  • branch_access - A reference to an Ast node for a branch access call

§Returns

The Id of the resolved branch and its Discipline (if the resolution succeeded)

Source

pub fn resolve_branch( &mut self, fold: &mut Fold<'lt>, branch: &Branch, ) -> Option<(Branch, DisciplineId)>

Resolves a branch such as (NET1,NET2) or ()

§Arguments
  • fold - The calling fold which is used for name resolution and error handling

  • branch - An Ast node describing a branch

§Returns

The Id of the resolved branch and its Discipline (if the resolution succeeded)

Auto Trait Implementations§

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> 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, 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.