#[non_exhaustive]pub struct BorrowedParams<'a>(pub Option<&'a SelfParam>, pub Vec<(&'a Param, LifetimeKind)>);Expand description
Parameters in a method that might be borrowed in the return type.
Tuple Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.0: Option<&'a SelfParam>§1: Vec<(&'a Param, LifetimeKind)>Implementations§
Source§impl BorrowedParams<'_>
impl BorrowedParams<'_>
Sourcepub fn return_names<'a>(
&'a self,
self_name: &'a Ident,
) -> impl Iterator<Item = &'a Ident>
pub fn return_names<'a>( &'a self, self_name: &'a Ident, ) -> impl Iterator<Item = &'a Ident>
Returns an Iterator through the names of the parameters that are borrowed
for the lifetime of the return value, accepting an Ident that the self
param will be called if present.
Sourcepub fn static_names(&self) -> impl Iterator<Item = &Ident>
pub fn static_names(&self) -> impl Iterator<Item = &Ident>
Returns an Iterator through the names of the parameters that are borrowed for a
static lifetime.
Sourcepub fn contains(&self, param_name: &Ident) -> bool
pub fn contains(&self, param_name: &Ident) -> bool
Returns true if a provided param name is included in the borrowed params,
otherwise false.
This method doesn’t check the self parameter. Use
BorrowedParams::borrows_self instead.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if there are no borrowed parameters, otherwise false.
Sourcepub fn borrows_self(&self) -> bool
pub fn borrows_self(&self) -> bool
Returns true if the self param is borrowed, otherwise false.
Sourcepub fn borrows_params(&self) -> bool
pub fn borrows_params(&self) -> bool
Returns true if there are any borrowed params, otherwise false.
Trait Implementations§
Source§impl<'a> Debug for BorrowedParams<'a>
impl<'a> Debug for BorrowedParams<'a>
Source§impl<'a> Default for BorrowedParams<'a>
impl<'a> Default for BorrowedParams<'a>
Source§fn default() -> BorrowedParams<'a>
fn default() -> BorrowedParams<'a>
Auto Trait Implementations§
impl<'a> Freeze for BorrowedParams<'a>
impl<'a> RefUnwindSafe for BorrowedParams<'a>
impl<'a> Send for BorrowedParams<'a>
impl<'a> Sync for BorrowedParams<'a>
impl<'a> Unpin for BorrowedParams<'a>
impl<'a> UnwindSafe for BorrowedParams<'a>
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
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: 32 bytes