pub struct MatchCase<'a> {
pub pattern: Arc<dyn Shape>,
pub guard: Option<&'a mut (dyn FnMut(&mut Cx, &ShapeBindings) -> Result<bool> + 'a)>,
}Expand description
One ordered Python structural-match case composed from a canonical Shape.
Fields§
§pattern: Arc<dyn Shape>Shape/pattern that performs structural checking and captures.
guard: Option<&'a mut (dyn FnMut(&mut Cx, &ShapeBindings) -> Result<bool> + 'a)>Optional guard evaluated only after this pattern accepts.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for MatchCase<'a>
impl<'a> !Send for MatchCase<'a>
impl<'a> !Sync for MatchCase<'a>
impl<'a> !UnwindSafe for MatchCase<'a>
impl<'a> Freeze for MatchCase<'a>
impl<'a> Unpin for MatchCase<'a>
impl<'a> UnsafeUnpin for MatchCase<'a>
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