pub enum Ty {
Empty,
Literal(TyLit),
Named(String),
Parameterized(Box<Ty>, Box<Ty>),
AnyOf(Vec<Ty>),
Function(TyFunc),
Table(Frame),
Infer,
}
Variants§
Empty
Literal(TyLit)
Named(String)
Parameterized(Box<Ty>, Box<Ty>)
AnyOf(Vec<Ty>)
Function(TyFunc)
Table(Frame)
Infer
Means that we have no information about the type of the variable and that it should be inferred from other usages.
Implementations§
source§impl Ty
impl Ty
sourcepub fn as_literal_mut(&mut self) -> Option<&mut TyLit>
pub fn as_literal_mut(&mut self) -> Option<&mut TyLit>
Optionally returns mutable references to the inner fields if this is a Ty::Literal
, otherwise None
sourcepub fn as_literal(&self) -> Option<&TyLit>
pub fn as_literal(&self) -> Option<&TyLit>
Optionally returns references to the inner fields if this is a Ty::Literal
, otherwise None
sourcepub fn into_literal(self) -> Result<TyLit, Self>
pub fn into_literal(self) -> Result<TyLit, Self>
Returns the inner fields if this is a Ty::Literal
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_named_mut(&mut self) -> Option<&mut String>
pub fn as_named_mut(&mut self) -> Option<&mut String>
Optionally returns mutable references to the inner fields if this is a Ty::Named
, otherwise None
sourcepub fn as_named(&self) -> Option<&String>
pub fn as_named(&self) -> Option<&String>
Optionally returns references to the inner fields if this is a Ty::Named
, otherwise None
sourcepub fn into_named(self) -> Result<String, Self>
pub fn into_named(self) -> Result<String, Self>
Returns the inner fields if this is a Ty::Named
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_parameterized_mut(&mut self) -> Option<(&mut Box<Ty>, &mut Box<Ty>)>
pub fn as_parameterized_mut(&mut self) -> Option<(&mut Box<Ty>, &mut Box<Ty>)>
Optionally returns mutable references to the inner fields if this is a Ty::Parameterized
, otherwise None
sourcepub fn as_parameterized(&self) -> Option<(&Box<Ty>, &Box<Ty>)>
pub fn as_parameterized(&self) -> Option<(&Box<Ty>, &Box<Ty>)>
Optionally returns references to the inner fields if this is a Ty::Parameterized
, otherwise None
sourcepub fn into_parameterized(self) -> Result<(Box<Ty>, Box<Ty>), Self>
pub fn into_parameterized(self) -> Result<(Box<Ty>, Box<Ty>), Self>
Returns the inner fields if this is a Ty::Parameterized
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_any_of_mut(&mut self) -> Option<&mut Vec<Ty>>
pub fn as_any_of_mut(&mut self) -> Option<&mut Vec<Ty>>
Optionally returns mutable references to the inner fields if this is a Ty::AnyOf
, otherwise None
sourcepub fn as_any_of(&self) -> Option<&Vec<Ty>>
pub fn as_any_of(&self) -> Option<&Vec<Ty>>
Optionally returns references to the inner fields if this is a Ty::AnyOf
, otherwise None
sourcepub fn into_any_of(self) -> Result<Vec<Ty>, Self>
pub fn into_any_of(self) -> Result<Vec<Ty>, Self>
Returns the inner fields if this is a Ty::AnyOf
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_function_mut(&mut self) -> Option<&mut TyFunc>
pub fn as_function_mut(&mut self) -> Option<&mut TyFunc>
Optionally returns mutable references to the inner fields if this is a Ty::Function
, otherwise None
sourcepub fn as_function(&self) -> Option<&TyFunc>
pub fn as_function(&self) -> Option<&TyFunc>
Optionally returns references to the inner fields if this is a Ty::Function
, otherwise None
sourcepub fn into_function(self) -> Result<TyFunc, Self>
pub fn into_function(self) -> Result<TyFunc, Self>
Returns the inner fields if this is a Ty::Function
, otherwise returns back the enum in the Err
case of the result
sourcepub fn as_table_mut(&mut self) -> Option<&mut Frame>
pub fn as_table_mut(&mut self) -> Option<&mut Frame>
Optionally returns mutable references to the inner fields if this is a Ty::Table
, otherwise None
sourcepub fn as_table(&self) -> Option<&Frame>
pub fn as_table(&self) -> Option<&Frame>
Optionally returns references to the inner fields if this is a Ty::Table
, otherwise None
sourcepub fn into_table(self) -> Result<Frame, Self>
pub fn into_table(self) -> Result<Frame, Self>
Returns the inner fields if this is a Ty::Table
, otherwise returns back the enum in the Err
case of the result
Trait Implementations§
source§impl<'de> Deserialize<'de> for Ty
impl<'de> Deserialize<'de> for Ty
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialOrd<Ty> for Ty
impl PartialOrd<Ty> for Ty
Implements a partial ordering or types:
- higher up are types that include many others (AnyOf, Any) and
- on the bottom are the atomic types (bool, string).
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl StructuralPartialEq for Ty
Auto Trait Implementations§
impl RefUnwindSafe for Ty
impl Send for Ty
impl Sync for Ty
impl Unpin for Ty
impl UnwindSafe for Ty
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg
or
a color-specific method, such as OwoColorize::green
, Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
, Read more