pub struct Assert<'a, T, A>where
T: Generatable<'a, A>,
A: 'a + TidAble<'a>,{
pub template: MaybeBorrowed<'a, T>,
pub assert: MaybeBorrowed<'a, A>,
}
Expand description
One of the Assert types provided by the crate, at this point in time also the only one.
This is backed by some template that the the type is checked against.
Every template must implement Generatable
so that it can be turned into tokens that actually
check if the type matches the template.
Further information about the structure of this crate can be found in the module documentation.
Fields§
§template: MaybeBorrowed<'a, T>
§assert: MaybeBorrowed<'a, A>
Trait Implementations§
Source§impl<'a, T, A> Assertable<'a> for Assert<'a, T, A>
impl<'a, T, A> Assertable<'a> for Assert<'a, T, A>
Source§impl<'a, Gen, A> AttachGenerics<'a> for Assert<'a, Gen, A>where
Gen: Generatable<'a, A>,
A: 'a + TidAble<'a>,
impl<'a, Gen, A> AttachGenerics<'a> for Assert<'a, Gen, A>where
Gen: Generatable<'a, A>,
A: 'a + TidAble<'a>,
Source§type Output = Assert<'a, Gen, A>
type Output = Assert<'a, Gen, A>
An optional type wrapper around the type the generics will be attached to
Used by this crate to wrap types with
MaybeBorrowed
to allow both
references and owned types to be represented by the same type.fn with_optional_generics<G>( self, generics: Option<G>, ) -> WithGenerics<'a, Self::Output>
Source§fn with_generics<G>(self, generics: G) -> WithGenerics<'a, Self::Output>
fn with_generics<G>(self, generics: G) -> WithGenerics<'a, Self::Output>
Attach some generics
G
to Self
. This allows for the generics to
to not exactly be syn::Generics
but any type that can be
turned into MaybeBorrowed<syn::Generics>
. This allows for
both &syn::Generics
and syn::Generics
to be attached using the
same trait.Auto Trait Implementations§
impl<'a, T, A> Freeze for Assert<'a, T, A>
impl<'a, T, A> RefUnwindSafe for Assert<'a, T, A>where
T: RefUnwindSafe,
A: RefUnwindSafe,
impl<'a, T, A> Send for Assert<'a, T, A>
impl<'a, T, A> Sync for Assert<'a, T, A>
impl<'a, T, A> Unpin for Assert<'a, T, A>
impl<'a, T, A> UnwindSafe for Assert<'a, T, A>
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
Attempts to downcast this to
T
behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
Attempts to downcast this to
T
behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
Attempts to downcast this to
T
behind Rc
pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
Attempts to downcast this to
T
behind Arc
pointerSource§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