pub struct DeclareGroup { /* private fields */ }
Implementations§
Source§impl DeclareGroup
impl DeclareGroup
pub fn new( span: Span, group: GroupIdx, fails: HashMap<usize, DeclareError>, status: DeclareState, ) -> Self
pub fn push_error(&mut self, at: usize, error: DeclareError)
pub fn filter_alive<F, C>(&mut self, filter: F) -> C
Sourcepub fn remove_branch(
&mut self,
branch: usize,
reason: DeclareError,
) -> DeclareError
pub fn remove_branch( &mut self, branch: usize, reason: DeclareError, ) -> DeclareError
remove only one branch
note: this method will do nothing if the branch is not exist(including have been remvoed)
Sourcepub fn remove_branches<F, R>(
&mut self,
remove_if: F,
reason: R,
) -> Vec<(Branch, DeclareError)>
pub fn remove_branches<F, R>( &mut self, remove_if: F, reason: R, ) -> Vec<(Branch, DeclareError)>
§Note
the DeclareError
generated by reason
will be clone many times, so, you should
call DeclareError::into_shared
to wrapped it in Rc
and, DeclareError::with_previous
will be called on DeclareError
pub fn alives<'t, A, T: 't>(&'t self, active: A) -> T
pub fn is_declared(&self) -> bool
pub fn make_error(&self) -> Error
Sourcepub fn get_branch(&self, branch: Branch) -> &Type
pub fn get_branch(&self, branch: Branch) -> &Type
§Panic
panic if the branch is not exist, faild, or isnot belong to this group
Trait Implementations§
Source§impl Clone for DeclareGroup
impl Clone for DeclareGroup
Source§fn clone(&self) -> DeclareGroup
fn clone(&self) -> DeclareGroup
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DeclareGroup
impl Debug for DeclareGroup
Auto Trait Implementations§
impl Freeze for DeclareGroup
impl RefUnwindSafe for DeclareGroup
impl !Send for DeclareGroup
impl !Sync for DeclareGroup
impl Unpin for DeclareGroup
impl UnwindSafe for DeclareGroup
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<W> WithSpanExt for Wwhere
W: WithSpan,
impl<W> WithSpanExt for Wwhere
W: WithSpan,
Source§fn make_parse_error(
&self,
reason: impl ToString,
kind: ParseErrorKind,
) -> ParseError
fn make_parse_error( &self, reason: impl ToString, kind: ParseErrorKind, ) -> ParseError
make an
ParseError
at location with ordered ParseErrorKind
Source§fn unmatch<T>(&self, reason: impl ToString) -> Result<T, ParseError>
fn unmatch<T>(&self, reason: impl ToString) -> Result<T, ParseError>
make an Unmatched
ParseError
in Result
Source§fn throw<T>(&self, reason: impl ToString) -> Result<T, ParseError>
fn throw<T>(&self, reason: impl ToString) -> Result<T, ParseError>
make an Semantic
ParseError
in Result