Struct DeclareGraph

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

used to declare which overload of function is called, or which possiable type is

Implementations§

Source§

impl DeclareGraph

Source

pub fn new() -> Self

Source

pub fn new_static_group<I>(&mut self, at: Span, items: I) -> GroupIdx
where I: IntoIterator<Item = Type>,

Source

pub fn build_group(&mut self, gb: GroupBuilder) -> GroupIdx

Source

pub fn apply_filter<T, B>(&mut self, gidx: GroupIdx, defs: &Defs, filter: B)
where T: Types, B: BranchFilter<T>,

Source

pub fn merge_group(&mut self, at: Span, base: GroupIdx, from: GroupIdx)

Source

pub fn declare_type(&mut self, at: Span, gidx: GroupIdx, expect_ty: &TypeDefine)

declare a DeclareGroup’s result is a type

return Err if the type has be declared and isn’t given type, or non of Branch match the given type

Source

pub fn declare_all(&mut self) -> Result<(), Vec<Error>>

Source

pub fn get_type(&self, gidx: GroupIdx) -> &TypeDefine

Trait Implementations§

Source§

impl Debug for DeclareGraph

Source§

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

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

impl Default for DeclareGraph

Source§

fn default() -> DeclareGraph

Returns the “default value” for a type. Read more
Source§

impl Index<Branch> for DeclareGraph

Source§

type Output = Type

The returned type after indexing.
Source§

fn index(&self, index: Branch) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl Index<GroupIdx> for DeclareGraph

Source§

type Output = DeclareGroup

The returned type after indexing.
Source§

fn index(&self, index: GroupIdx) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl IndexMut<GroupIdx> for DeclareGraph

Source§

fn index_mut(&mut self, index: GroupIdx) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more

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.