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 unsafe fn into_query_def_unchecked(self) -> Box<QueryDef>
pub unsafe fn into_query_def_unchecked(self) -> Box<QueryDef>
Unchecked return of the inner fields of StmtKind::QueryDef.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_query_def_unchecked(&self) -> &Box<QueryDef>
pub unsafe fn as_query_def_unchecked(&self) -> &Box<QueryDef>
Unchecked reference of the inner fields of StmtKind::QueryDef.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_query_def_mut_unchecked(&mut self) -> &mut Box<QueryDef>
pub unsafe fn as_query_def_mut_unchecked(&mut self) -> &mut Box<QueryDef>
Unchecked mutable reference of the inner fields of StmtKind::QueryDef.
§Safety
Results in undefined behavior when it is the incorrect variant.
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 unsafe fn into_var_def_unchecked(self) -> VarDef
pub unsafe fn into_var_def_unchecked(self) -> VarDef
Unchecked return of the inner fields of StmtKind::VarDef.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_var_def_unchecked(&self) -> &VarDef
pub unsafe fn as_var_def_unchecked(&self) -> &VarDef
Unchecked reference of the inner fields of StmtKind::VarDef.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_var_def_mut_unchecked(&mut self) -> &mut VarDef
pub unsafe fn as_var_def_mut_unchecked(&mut self) -> &mut VarDef
Unchecked mutable reference of the inner fields of StmtKind::VarDef.
§Safety
Results in undefined behavior when it is the incorrect variant.
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 unsafe fn into_type_def_unchecked(self) -> TypeDef
pub unsafe fn into_type_def_unchecked(self) -> TypeDef
Unchecked return of the inner fields of StmtKind::TypeDef.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_type_def_unchecked(&self) -> &TypeDef
pub unsafe fn as_type_def_unchecked(&self) -> &TypeDef
Unchecked reference of the inner fields of StmtKind::TypeDef.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_type_def_mut_unchecked(&mut self) -> &mut TypeDef
pub unsafe fn as_type_def_mut_unchecked(&mut self) -> &mut TypeDef
Unchecked mutable reference of the inner fields of StmtKind::TypeDef.
§Safety
Results in undefined behavior when it is the incorrect variant.
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 unsafe fn into_module_def_unchecked(self) -> ModuleDef
pub unsafe fn into_module_def_unchecked(self) -> ModuleDef
Unchecked return of the inner fields of StmtKind::ModuleDef.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_module_def_unchecked(&self) -> &ModuleDef
pub unsafe fn as_module_def_unchecked(&self) -> &ModuleDef
Unchecked reference of the inner fields of StmtKind::ModuleDef.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_module_def_mut_unchecked(&mut self) -> &mut ModuleDef
pub unsafe fn as_module_def_mut_unchecked(&mut self) -> &mut ModuleDef
Unchecked mutable reference of the inner fields of StmtKind::ModuleDef.
§Safety
Results in undefined behavior when it is the incorrect variant.
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
Sourcepub unsafe fn into_import_def_unchecked(self) -> ImportDef
pub unsafe fn into_import_def_unchecked(self) -> ImportDef
Unchecked return of the inner fields of StmtKind::ImportDef.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_import_def_unchecked(&self) -> &ImportDef
pub unsafe fn as_import_def_unchecked(&self) -> &ImportDef
Unchecked reference of the inner fields of StmtKind::ImportDef.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_import_def_mut_unchecked(&mut self) -> &mut ImportDef
pub unsafe fn as_import_def_mut_unchecked(&mut self) -> &mut ImportDef
Unchecked mutable reference of the inner fields of StmtKind::ImportDef.
§Safety
Results in undefined behavior when it is the incorrect variant.
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 UnsafeUnpin 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 moreSource§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
WrappingSpan::make_wrapped to wrap an AST node in a span.