[−][src]Trait gsrs::DerefWithLifetime
This trait should be implemented for any struct that will contain references to data inside SRS
and it should be implemented for any lifetime.
Basically it just allows to apply custom lifetime to struct
It is already implemented for pure references. In general `deref_with_lifetime' macro should be used to implement this trait safely.
It is unsafe because SRS expects implementations of this trait to only change lifetime.
TODO this will only be implemented with macro in future
Associated Types
type Target: 'a
Implementors should make Target
a Self but generic over 'a
, see macro definition
Required methods
unsafe fn deref_with_lifetime(&'a self) -> &'a Self::Target
implementation should be just transmute(self)
to only change lifetime
unsafe fn deref_with_lifetime_mut(&'a mut self) -> &'a mut Self::Target
implementation should be just transmute(self)
to only change lifetime
unsafe fn move_with_lifetime(self) -> Self::Target
implementation should be just transmute(self)
to only change lifetime
unsafe fn move_with_lifetime_back(this: Self::Target) -> Self
implementation should be just transmute(self)
to only change lifetime