pub struct Ref<'a, C>(pub &'a C);
Expand description
This exists as a wrapper around &'a T
so that
Date<&'a C>
is possible for calendar C
.
Unfortunately,
AsCalendar
cannot be implemented on &'a T
directly because
&'a T
is #[fundamental]
and the impl would clash with the one above with
AsCalendar
for C: Calendar
.
Use Date<Ref<'a, C>>
where you would use Date<&'a C>
Tuple Fields§
§0: &'a C
Trait Implementations§
source§impl<C> AsCalendar for Ref<'_, C>where
C: Calendar,
impl<C> AsCalendar for Ref<'_, C>where
C: Calendar,
impl<C> Copy for Ref<'_, C>
impl<'a, C> Eq for Ref<'a, C>where
C: Eq,
impl<'a, C> StructuralPartialEq for Ref<'a, C>
Auto Trait Implementations§
impl<'a, C> Freeze for Ref<'a, C>
impl<'a, C> RefUnwindSafe for Ref<'a, C>where
C: RefUnwindSafe,
impl<'a, C> Send for Ref<'a, C>where
C: Sync,
impl<'a, C> Sync for Ref<'a, C>where
C: Sync,
impl<'a, C> Unpin for Ref<'a, C>
impl<'a, C> UnwindSafe for Ref<'a, C>where
C: RefUnwindSafe,
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
)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