pub enum TyTupleField {
Single(Option<String>, Option<Ty>),
Wildcard(Option<Ty>),
}Variants§
Single(Option<String>, Option<Ty>)
Named tuple element.
Wildcard(Option<Ty>)
Placeholder for possibly many elements. Means “and other unmentioned columns”. Does not mean “all columns”.
Implementations§
Source§impl TyTupleField
impl TyTupleField
Sourcepub fn is_single(&self) -> bool
pub fn is_single(&self) -> bool
Returns true if this is a TyTupleField::Single, otherwise false
Sourcepub fn as_single_mut(
&mut self,
) -> Option<(&mut Option<String>, &mut Option<Ty>)>
pub fn as_single_mut( &mut self, ) -> Option<(&mut Option<String>, &mut Option<Ty>)>
Optionally returns mutable references to the inner fields if this is a TyTupleField::Single, otherwise None
Sourcepub fn as_single(&self) -> Option<(&Option<String>, &Option<Ty>)>
pub fn as_single(&self) -> Option<(&Option<String>, &Option<Ty>)>
Optionally returns references to the inner fields if this is a TyTupleField::Single, otherwise None
Sourcepub fn into_single(self) -> Result<(Option<String>, Option<Ty>), Self>
pub fn into_single(self) -> Result<(Option<String>, Option<Ty>), Self>
Returns the inner fields if this is a TyTupleField::Single, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_single_unchecked(self) -> (Option<String>, Option<Ty>)
pub unsafe fn into_single_unchecked(self) -> (Option<String>, Option<Ty>)
Unchecked return of the inner fields of TyTupleField::Single.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_single_unchecked(&self) -> (&Option<String>, &Option<Ty>)
pub unsafe fn as_single_unchecked(&self) -> (&Option<String>, &Option<Ty>)
Unchecked reference of the inner fields of TyTupleField::Single.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_single_mut_unchecked(
&mut self,
) -> (&mut Option<String>, &mut Option<Ty>)
pub unsafe fn as_single_mut_unchecked( &mut self, ) -> (&mut Option<String>, &mut Option<Ty>)
Unchecked mutable reference of the inner fields of TyTupleField::Single.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn is_wildcard(&self) -> bool
pub fn is_wildcard(&self) -> bool
Returns true if this is a TyTupleField::Wildcard, otherwise false
Sourcepub fn as_wildcard_mut(&mut self) -> Option<&mut Option<Ty>>
pub fn as_wildcard_mut(&mut self) -> Option<&mut Option<Ty>>
Optionally returns mutable references to the inner fields if this is a TyTupleField::Wildcard, otherwise None
Sourcepub fn as_wildcard(&self) -> Option<&Option<Ty>>
pub fn as_wildcard(&self) -> Option<&Option<Ty>>
Optionally returns references to the inner fields if this is a TyTupleField::Wildcard, otherwise None
Sourcepub fn into_wildcard(self) -> Result<Option<Ty>, Self>
pub fn into_wildcard(self) -> Result<Option<Ty>, Self>
Returns the inner fields if this is a TyTupleField::Wildcard, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_wildcard_unchecked(self) -> Option<Ty>
pub unsafe fn into_wildcard_unchecked(self) -> Option<Ty>
Unchecked return of the inner fields of TyTupleField::Wildcard.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_wildcard_unchecked(&self) -> &Option<Ty>
pub unsafe fn as_wildcard_unchecked(&self) -> &Option<Ty>
Unchecked reference of the inner fields of TyTupleField::Wildcard.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_wildcard_mut_unchecked(&mut self) -> &mut Option<Ty>
pub unsafe fn as_wildcard_mut_unchecked(&mut self) -> &mut Option<Ty>
Unchecked mutable reference of the inner fields of TyTupleField::Wildcard.
§Safety
Results in undefined behavior when it is the incorrect variant.
Trait Implementations§
Source§impl Clone for TyTupleField
impl Clone for TyTupleField
Source§fn clone(&self) -> TyTupleField
fn clone(&self) -> TyTupleField
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TyTupleField
impl Debug for TyTupleField
Source§impl<'de> Deserialize<'de> for TyTupleField
impl<'de> Deserialize<'de> for TyTupleField
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 TyTupleField
impl JsonSchema for TyTupleField
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 moreSource§impl PartialEq for TyTupleField
impl PartialEq for TyTupleField
Source§impl Serialize for TyTupleField
impl Serialize for TyTupleField
impl StructuralPartialEq for TyTupleField
Auto Trait Implementations§
impl Freeze for TyTupleField
impl RefUnwindSafe for TyTupleField
impl Send for TyTupleField
impl Sync for TyTupleField
impl Unpin for TyTupleField
impl UnsafeUnpin for TyTupleField
impl UnwindSafe for TyTupleField
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.