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
sourceimpl<'_, C> AsCalendar for Ref<'_, C> where
C: Calendar,
impl<'_, C> AsCalendar for Ref<'_, C> where
C: Calendar,
type Calendar = C
type Calendar = C
The calendar being wrapped
sourcefn as_calendar(&self) -> &C
fn as_calendar(&self) -> &C
Obtain the inner calendar
impl<'_, C> Copy for Ref<'_, C>
impl<'a, C> Eq for Ref<'a, C> where
C: Eq,
impl<'a, C> StructuralEq for Ref<'a, C>
impl<'a, C> StructuralPartialEq for Ref<'a, C>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more