pub struct PointerDereferencer<P> { /* private fields */ }Expand description
Updatable, Getter, Settable, and TimeGetter are passed through Box,
Rc<RefCell<T>>, Arc<RwLock<T>>, and Arc<Mutex<T>>, but this cannot be done safely for
references involving raw pointer dereferencing. This is a wrapper struct that provides this
functionality for *mut T, *const RwLock<T>, and *const Mutex<T>. It’s constructor is
unsafe fn, so this is considered sound.
Implementations§
Source§impl<P> PointerDereferencer<P>
impl<P> PointerDereferencer<P>
Sourcepub const unsafe fn new(pointer: P) -> Self
pub const unsafe fn new(pointer: P) -> Self
The constructor for PointerDereferencer. Although this constructor itself does not run any
unsafe code, it is unsafe fn since this type inherently performs unsafe functions. See the
type documentation for more information.
Although it is technically possible to construct a PointerDereferencer<P> where P is not
a raw pointer, there is no valid reason to do so and the object would be entirely useless.
Source§impl<P: Clone> PointerDereferencer<P>
impl<P: Clone> PointerDereferencer<P>
Source§impl<P: Copy> PointerDereferencer<P>
impl<P: Copy> PointerDereferencer<P>
Source§impl<T> PointerDereferencer<*mut T>
These functions get a PointerDereferencer<*mut dyn Trait> from a PointerDereferencer<*mut T>
where T: Trait. Because raw pointers are Copy, they only require &self and do not consume
the original PointerDereferencer. Unfortunately T currently must be Sized due to language
limitations.
impl<T> PointerDereferencer<*mut T>
These functions get a PointerDereferencer<*mut dyn Trait> from a PointerDereferencer<*mut T>
where T: Trait. Because raw pointers are Copy, they only require &self and do not consume
the original PointerDereferencer. Unfortunately T currently must be Sized due to language
limitations.
pub const fn as_dyn_updatable<E: Clone + Debug>(
&self,
) -> PointerDereferencer<*mut dyn Updatable<E> + '_>where
T: Updatable<E>,
pub const fn as_dyn_getter<U, E: Clone + Debug>(
&self,
) -> PointerDereferencer<*mut dyn Getter<U, E> + '_>where
T: Getter<U, E>,
pub const fn as_dyn_settable<U, E: Clone + Debug>(
&self,
) -> PointerDereferencer<*mut dyn Settable<U, E> + '_>where
T: Settable<U, E>,
pub const fn as_dyn_time_getter<E: Clone + Debug>(
&self,
) -> PointerDereferencer<*mut dyn TimeGetter<E> + '_>where
T: TimeGetter<E>,
pub const fn as_dyn_chronology<U>(
&self,
) -> PointerDereferencer<*mut dyn Chronology<U> + '_>where
T: Chronology<U>,
Source§impl<T> PointerDereferencer<*const RwLock<T>>
These functions get a PointerDereferencer<*const RwLock<dyn Trait>> from a
PointerDereferencer<*const RwLock<T>> where T: Trait. Because raw pointers are Copy, they
only require &self and do not consume the original PointerDereferencer. Unfortunately T
currently must be Sized due to language limitations.
impl<T> PointerDereferencer<*const RwLock<T>>
These functions get a PointerDereferencer<*const RwLock<dyn Trait>> from a
PointerDereferencer<*const RwLock<T>> where T: Trait. Because raw pointers are Copy, they
only require &self and do not consume the original PointerDereferencer. Unfortunately T
currently must be Sized due to language limitations.
pub const fn as_dyn_updatable<E: Clone + Debug>(
&self,
) -> PointerDereferencer<*const RwLock<dyn Updatable<E> + '_>>where
T: Updatable<E>,
pub const fn as_dyn_getter<U, E: Clone + Debug>(
&self,
) -> PointerDereferencer<*const RwLock<dyn Getter<U, E> + '_>>where
T: Getter<U, E>,
pub const fn as_dyn_settable<U, E: Clone + Debug>(
&self,
) -> PointerDereferencer<*const RwLock<dyn Settable<U, E> + '_>>where
T: Settable<U, E>,
pub const fn as_dyn_time_getter<E: Clone + Debug>(
&self,
) -> PointerDereferencer<*const RwLock<dyn TimeGetter<E> + '_>>where
T: TimeGetter<E>,
Source§impl<T> PointerDereferencer<*const Mutex<T>>
These functions get a PointerDereferencer<*const Mutex<dyn Trait>> from a
PointerDereferencer<*const Mutex<T>> where T: Trait. Because raw pointers are Copy, they
only require &self and do not consume the original PointerDereferencer. Unfortunately T
currently must be Sized due to language limitations.
impl<T> PointerDereferencer<*const Mutex<T>>
These functions get a PointerDereferencer<*const Mutex<dyn Trait>> from a
PointerDereferencer<*const Mutex<T>> where T: Trait. Because raw pointers are Copy, they
only require &self and do not consume the original PointerDereferencer. Unfortunately T
currently must be Sized due to language limitations.
pub const fn as_dyn_updatable<E: Clone + Debug>(
&self,
) -> PointerDereferencer<*const Mutex<dyn Updatable<E> + '_>>where
T: Updatable<E>,
pub const fn as_dyn_getter<U, E: Clone + Debug>(
&self,
) -> PointerDereferencer<*const Mutex<dyn Getter<U, E> + '_>>where
T: Getter<U, E>,
pub const fn as_dyn_settable<U, E: Clone + Debug>(
&self,
) -> PointerDereferencer<*const Mutex<dyn Settable<U, E> + '_>>where
T: Settable<U, E>,
pub const fn as_dyn_time_getter<E: Clone + Debug>(
&self,
) -> PointerDereferencer<*const Mutex<dyn TimeGetter<E> + '_>>where
T: TimeGetter<E>,
Source§impl<T> PointerDereferencer<*const T>
impl<T> PointerDereferencer<*const T>
pub const fn as_dyn_chronology<U>(
&self,
) -> PointerDereferencer<*const dyn Chronology<U> + '_>where
T: Chronology<U>,
Trait Implementations§
Source§impl<T, C: ?Sized + Chronology<T>> Chronology<T> for PointerDereferencer<*mut C>
impl<T, C: ?Sized + Chronology<T>> Chronology<T> for PointerDereferencer<*mut C>
Source§impl<T, C: ?Sized + Chronology<T>> Chronology<T> for PointerDereferencer<*const C>
impl<T, C: ?Sized + Chronology<T>> Chronology<T> for PointerDereferencer<*const C>
Source§impl<P: Clone> Clone for PointerDereferencer<P>
impl<P: Clone> Clone for PointerDereferencer<P>
Source§fn clone(&self) -> PointerDereferencer<P>
fn clone(&self) -> PointerDereferencer<P>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<P: Copy> Copy for PointerDereferencer<P>
Source§impl<P: Debug> Debug for PointerDereferencer<P>
impl<P: Debug> Debug for PointerDereferencer<P>
impl<P: Eq> Eq for PointerDereferencer<P>
Source§impl<T, G: ?Sized + Getter<T, E>, E: Clone + Debug> Getter<T, E> for PointerDereferencer<*mut G>
impl<T, G: ?Sized + Getter<T, E>, E: Clone + Debug> Getter<T, E> for PointerDereferencer<*mut G>
Source§impl<G: ?Sized + Getter<T, E>, T, E: Clone + Debug> Getter<T, E> for PointerDereferencer<*const RwLock<G>>
Available on crate feature std only.
impl<G: ?Sized + Getter<T, E>, T, E: Clone + Debug> Getter<T, E> for PointerDereferencer<*const RwLock<G>>
std only.Source§impl<G: ?Sized + Getter<T, E>, T, E: Clone + Debug> Getter<T, E> for PointerDereferencer<*const Mutex<G>>
Available on crate feature std only.
impl<G: ?Sized + Getter<T, E>, T, E: Clone + Debug> Getter<T, E> for PointerDereferencer<*const Mutex<G>>
std only.Source§impl<P: PartialEq> PartialEq for PointerDereferencer<P>
impl<P: PartialEq> PartialEq for PointerDereferencer<P>
Source§impl<T, S: ?Sized + Settable<T, E>, E: Clone + Debug> Settable<T, E> for PointerDereferencer<*mut S>
impl<T, S: ?Sized + Settable<T, E>, E: Clone + Debug> Settable<T, E> for PointerDereferencer<*mut S>
Source§fn set(&mut self, value: T) -> NothingOrError<E>
fn set(&mut self, value: T) -> NothingOrError<E>
Source§impl<S: ?Sized + Settable<T, E>, T, E: Clone + Debug> Settable<T, E> for PointerDereferencer<*const RwLock<S>>
Available on crate feature std only.
impl<S: ?Sized + Settable<T, E>, T, E: Clone + Debug> Settable<T, E> for PointerDereferencer<*const RwLock<S>>
std only.Source§fn set(&mut self, value: T) -> NothingOrError<E>
fn set(&mut self, value: T) -> NothingOrError<E>
Source§impl<S: ?Sized + Settable<T, E>, T, E: Clone + Debug> Settable<T, E> for PointerDereferencer<*const Mutex<S>>
Available on crate feature std only.
impl<S: ?Sized + Settable<T, E>, T, E: Clone + Debug> Settable<T, E> for PointerDereferencer<*const Mutex<S>>
std only.Source§fn set(&mut self, value: T) -> NothingOrError<E>
fn set(&mut self, value: T) -> NothingOrError<E>
impl<P: PartialEq> StructuralPartialEq for PointerDereferencer<P>
Source§impl<TG: ?Sized + TimeGetter<E>, E: Clone + Debug> TimeGetter<E> for PointerDereferencer<*mut TG>
impl<TG: ?Sized + TimeGetter<E>, E: Clone + Debug> TimeGetter<E> for PointerDereferencer<*mut TG>
Source§fn get(&self) -> TimeOutput<E>
fn get(&self) -> TimeOutput<E>
Source§impl<TG: ?Sized + TimeGetter<E>, E: Clone + Debug> TimeGetter<E> for PointerDereferencer<*const RwLock<TG>>
Available on crate feature std only.
impl<TG: ?Sized + TimeGetter<E>, E: Clone + Debug> TimeGetter<E> for PointerDereferencer<*const RwLock<TG>>
std only.Source§fn get(&self) -> TimeOutput<E>
fn get(&self) -> TimeOutput<E>
Source§impl<TG: ?Sized + TimeGetter<E>, E: Clone + Debug> TimeGetter<E> for PointerDereferencer<*const Mutex<TG>>
Available on crate feature std only.
impl<TG: ?Sized + TimeGetter<E>, E: Clone + Debug> TimeGetter<E> for PointerDereferencer<*const Mutex<TG>>
std only.