#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
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>
Returns the “default value” for a type. Read more
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
Mutably borrows from an owned value. Read more