Enum erg_compiler::varinfo::ParamId
source · [−]pub enum ParamId {
PatNonDefault(usize),
PatWithDefault(usize),
VarNonDefault {
keyword: Str,
pos: usize,
},
VarWithDefault {
keyword: Str,
pos: usize,
},
Embedded(Str),
}
Variants
PatNonDefault(usize)
変数でないパターン
e.g. [x, y]
of f [x, y], z = ...
PatWithDefault(usize)
e.g. [x, y]
of f [x, y] |= [0, 1] = ...
VarNonDefault
変数パターン
e.g. z
of f [x, y], z = ...
VarWithDefault
e.g. z
of f [x, y], z |= 0 = ...
Embedded(Str)
パターンに埋め込まれた変数パターン
この場合デフォルト値はない
e.g. x
or y
of f [x, y], z = ...
Implementations
sourceimpl ParamId
impl ParamId
pub const fn var_default(keyword: Str, pos: usize) -> Self
pub const fn var_non_default(keyword: Str, pos: usize) -> Self
pub const fn pos(&self) -> Option<usize>
pub const fn has_default(&self) -> bool
pub const fn is_embedded(&self) -> bool
Trait Implementations
impl Eq for ParamId
impl StructuralEq for ParamId
impl StructuralPartialEq for ParamId
Auto Trait Implementations
impl RefUnwindSafe for ParamId
impl !Send for ParamId
impl !Sync for ParamId
impl Unpin for ParamId
impl UnwindSafe for ParamId
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more