pub enum GenericBound {
TraitBound {
trait_: Path,
generic_params: Vec<GenericParamDef>,
modifier: TraitBoundModifier,
},
Outlives(String),
Use(Vec<String>),
}
Expand description
Either a trait bound or a lifetime bound.
Variants§
TraitBound
A trait bound.
Fields
§
generic_params: Vec<GenericParamDef>
Used for Higher-Rank Trait Bounds (HRTBs)
where F: for<'a, 'b> Fn(&'a u8, &'b u8)
^^^^^^^^^^^
|
this part
§
modifier: TraitBoundModifier
The context for which a trait is supposed to be used, e.g. `const
Outlives(String)
A lifetime bound, e.g.
fn f<'a, T>(x: &'a str, y: &T) where T: 'a {}
// ^^^
Use(Vec<String>)
use<'a, T>
precise-capturing bound syntax
Trait Implementations§
Source§impl Clone for GenericBound
impl Clone for GenericBound
Source§fn clone(&self) -> GenericBound
fn clone(&self) -> GenericBound
Returns a copy of the value. Read more
1.0.0 · 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 GenericBound
impl Debug for GenericBound
Source§impl<'de> Deserialize<'de> for GenericBound
impl<'de> Deserialize<'de> for GenericBound
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for GenericBound
impl Hash for GenericBound
Source§impl PartialEq for GenericBound
impl PartialEq for GenericBound
Source§impl Serialize for GenericBound
impl Serialize for GenericBound
impl Eq for GenericBound
impl StructuralPartialEq for GenericBound
Auto Trait Implementations§
impl Freeze for GenericBound
impl RefUnwindSafe for GenericBound
impl Send for GenericBound
impl Sync for GenericBound
impl Unpin for GenericBound
impl UnwindSafe for GenericBound
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 72 bytes
Size for each variant:
TraitBound
: 72 bytesOutlives
: 32 bytesUse
: 32 bytes