pub enum StmtKind {
QueryDef(Box<QueryDef>),
VarDef(VarDef),
TypeDef(TypeDef),
ModuleDef(ModuleDef),
ImportDef(ImportDef),
}
Variants§
Implementations§
Source§impl StmtKind
impl StmtKind
Sourcepub fn is_query_def(&self) -> bool
pub fn is_query_def(&self) -> bool
Returns true if this is a StmtKind::QueryDef
, otherwise false
Sourcepub fn as_query_def_mut(&mut self) -> Option<&mut Box<QueryDef>>
pub fn as_query_def_mut(&mut self) -> Option<&mut Box<QueryDef>>
Optionally returns mutable references to the inner fields if this is a StmtKind::QueryDef
, otherwise None
Sourcepub fn as_query_def(&self) -> Option<&Box<QueryDef>>
pub fn as_query_def(&self) -> Option<&Box<QueryDef>>
Optionally returns references to the inner fields if this is a StmtKind::QueryDef
, otherwise None
Sourcepub fn into_query_def(self) -> Result<Box<QueryDef>, Self>
pub fn into_query_def(self) -> Result<Box<QueryDef>, Self>
Returns the inner fields if this is a StmtKind::QueryDef
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_var_def(&self) -> bool
pub fn is_var_def(&self) -> bool
Returns true if this is a StmtKind::VarDef
, otherwise false
Sourcepub fn as_var_def_mut(&mut self) -> Option<&mut VarDef>
pub fn as_var_def_mut(&mut self) -> Option<&mut VarDef>
Optionally returns mutable references to the inner fields if this is a StmtKind::VarDef
, otherwise None
Sourcepub fn as_var_def(&self) -> Option<&VarDef>
pub fn as_var_def(&self) -> Option<&VarDef>
Optionally returns references to the inner fields if this is a StmtKind::VarDef
, otherwise None
Sourcepub fn into_var_def(self) -> Result<VarDef, Self>
pub fn into_var_def(self) -> Result<VarDef, Self>
Returns the inner fields if this is a StmtKind::VarDef
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_type_def(&self) -> bool
pub fn is_type_def(&self) -> bool
Returns true if this is a StmtKind::TypeDef
, otherwise false
Sourcepub fn as_type_def_mut(&mut self) -> Option<&mut TypeDef>
pub fn as_type_def_mut(&mut self) -> Option<&mut TypeDef>
Optionally returns mutable references to the inner fields if this is a StmtKind::TypeDef
, otherwise None
Sourcepub fn as_type_def(&self) -> Option<&TypeDef>
pub fn as_type_def(&self) -> Option<&TypeDef>
Optionally returns references to the inner fields if this is a StmtKind::TypeDef
, otherwise None
Sourcepub fn into_type_def(self) -> Result<TypeDef, Self>
pub fn into_type_def(self) -> Result<TypeDef, Self>
Returns the inner fields if this is a StmtKind::TypeDef
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_module_def(&self) -> bool
pub fn is_module_def(&self) -> bool
Returns true if this is a StmtKind::ModuleDef
, otherwise false
Sourcepub fn as_module_def_mut(&mut self) -> Option<&mut ModuleDef>
pub fn as_module_def_mut(&mut self) -> Option<&mut ModuleDef>
Optionally returns mutable references to the inner fields if this is a StmtKind::ModuleDef
, otherwise None
Sourcepub fn as_module_def(&self) -> Option<&ModuleDef>
pub fn as_module_def(&self) -> Option<&ModuleDef>
Optionally returns references to the inner fields if this is a StmtKind::ModuleDef
, otherwise None
Sourcepub fn into_module_def(self) -> Result<ModuleDef, Self>
pub fn into_module_def(self) -> Result<ModuleDef, Self>
Returns the inner fields if this is a StmtKind::ModuleDef
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_import_def(&self) -> bool
pub fn is_import_def(&self) -> bool
Returns true if this is a StmtKind::ImportDef
, otherwise false
Sourcepub fn as_import_def_mut(&mut self) -> Option<&mut ImportDef>
pub fn as_import_def_mut(&mut self) -> Option<&mut ImportDef>
Optionally returns mutable references to the inner fields if this is a StmtKind::ImportDef
, otherwise None
Sourcepub fn as_import_def(&self) -> Option<&ImportDef>
pub fn as_import_def(&self) -> Option<&ImportDef>
Optionally returns references to the inner fields if this is a StmtKind::ImportDef
, otherwise None
Sourcepub fn into_import_def(self) -> Result<ImportDef, Self>
pub fn into_import_def(self) -> Result<ImportDef, Self>
Returns the inner fields if this is a StmtKind::ImportDef
, otherwise returns back the enum in the Err
case of the result
Trait Implementations§
Source§impl<'de> Deserialize<'de> for StmtKind
impl<'de> Deserialize<'de> for StmtKind
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 JsonSchema for StmtKind
impl JsonSchema for StmtKind
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref
keyword. Read moreimpl StructuralPartialEq for StmtKind
Auto Trait Implementations§
impl Freeze for StmtKind
impl RefUnwindSafe for StmtKind
impl Send for StmtKind
impl Sync for StmtKind
impl Unpin for StmtKind
impl UnwindSafe for StmtKind
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
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