pub struct TypeNameRef(/* private fields */);Expand description
Represents a reference to a custom type (struct or enum).
Implementations§
Source§impl TypeNameRef
impl TypeNameRef
Sourcepub fn new(name: impl Into<String>, ty: CustomType) -> Self
pub fn new(name: impl Into<String>, ty: CustomType) -> Self
Constructs a new TypeNameRef.
Sourcepub fn ty(&self) -> &CustomType
pub fn ty(&self) -> &CustomType
Gets the referenced custom type.
Sourcepub fn as_struct(&self) -> Option<&StructType>
pub fn as_struct(&self) -> Option<&StructType>
Converts the referenced custom type to a struct type.
Returns None if the referenced custom type is not a struct.
Trait Implementations§
Source§impl Clone for TypeNameRef
impl Clone for TypeNameRef
Source§fn clone(&self) -> TypeNameRef
fn clone(&self) -> TypeNameRef
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TypeNameRef
impl Debug for TypeNameRef
Source§impl Display for TypeNameRef
impl Display for TypeNameRef
impl Eq for TypeNameRef
Source§impl From<TypeNameRef> for Type
impl From<TypeNameRef> for Type
Source§fn from(value: TypeNameRef) -> Self
fn from(value: TypeNameRef) -> Self
Converts to this type from the input type.
Source§impl PartialEq for TypeNameRef
impl PartialEq for TypeNameRef
impl StructuralPartialEq for TypeNameRef
Auto Trait Implementations§
impl Freeze for TypeNameRef
impl RefUnwindSafe for TypeNameRef
impl Send for TypeNameRef
impl Sync for TypeNameRef
impl Unpin for TypeNameRef
impl UnsafeUnpin for TypeNameRef
impl UnwindSafe for TypeNameRef
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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