pub struct CmdArgType {
pub optional: bool,
pub opt_labels: Vec<(String, MonoType)>,
pub ty: MonoType,
}Expand description
One command argument type: ty for a mandatory argument, or ty? for
an optional one (v0.0.6: MandatoryArgumentType / OptionalArgumentType,
types.cppo.ml:326-328). optional/opt_labels are version-discriminated
by construction: under V0_0
(positional model) optional marks a whole-slot ty? optional and
opt_labels is always empty; under V0_1 (labeled model, upstream
CommandArgType of typ LabelMap.t * typ, types.cppo.ml:214) optional
is always false and opt_labels carries this slot’s ?(l:τ,…) bundle —
a CLOSED map (no row variable: upstream discards one if written,
parser.mly:866’s TODO (error)). Kept sorted by label at every
producer (command_scheme’s harvest, lower_type_atom’s sig lowering) so
unify/Display/sealing are order-insensitive — see unify_cmd_args’s
zip-equal equal-domain test.
See MonoType for what the #[subast] list means. opt_labels is the
field four hand-written walks forgot; the generated traversal cannot.
Fields§
§optional: bool§opt_labels: Vec<(String, MonoType)>§ty: MonoTypeImplementations§
Source§impl CmdArgType
impl CmdArgType
Sourcepub fn visit<__T>(&self, visitor: impl IntoVisitor<__T>) -> &Self
pub fn visit<__T>(&self, visitor: impl IntoVisitor<__T>) -> &Self
Visit self with any Visit, returning self to chain.
Source§impl CmdArgType
impl CmdArgType
Sourcepub fn visit_mut<__T>(&mut self, visitor: impl IntoVisitorMut<__T>) -> &mut Self
pub fn visit_mut<__T>(&mut self, visitor: impl IntoVisitorMut<__T>) -> &mut Self
Visit self with any VisitMut, returning self to chain.
Trait Implementations§
impl Ast for CmdArgType
Source§impl Clone for CmdArgType
impl Clone for CmdArgType
Source§fn clone(&self) -> CmdArgType
fn clone(&self) -> CmdArgType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CmdArgType
impl Debug for CmdArgType
Source§impl<__F: FnMut(&CmdArgType)> IntoHook<CmdArgType> for __F
impl<__F: FnMut(&CmdArgType)> IntoHook<CmdArgType> for __F
Source§impl<__F: FnMut(&mut CmdArgType)> IntoHookMut<CmdArgType> for __F
impl<__F: FnMut(&mut CmdArgType)> IntoHookMut<CmdArgType> for __F
fn into_hook_mut(self) -> impl HookMut
Source§impl<__F: FnMut(&CmdArgType)> IntoVisitor<CmdArgType> for __F
impl<__F: FnMut(&CmdArgType)> IntoVisitor<CmdArgType> for __F
fn into_visitor(self) -> impl Visit
Source§impl<__F: FnMut(&mut CmdArgType)> IntoVisitorMut<CmdArgType> for __F
impl<__F: FnMut(&mut CmdArgType)> IntoVisitorMut<CmdArgType> for __F
fn into_visitor_mut(self) -> impl VisitMut
Source§impl Repeater<0> for CmdArgType
impl Repeater<0> for CmdArgType
Source§impl Repeater<1> for CmdArgType
impl Repeater<1> for CmdArgType
Auto Trait Implementations§
impl !RefUnwindSafe for CmdArgType
impl !Send for CmdArgType
impl !Sync for CmdArgType
impl !UnwindSafe for CmdArgType
impl Freeze for CmdArgType
impl Unpin for CmdArgType
impl UnsafeUnpin for CmdArgType
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more