[−][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
For simple cases it is better to use `deref_with_lifetime' macro.
It can not introduce any unsoundness by itself, because this functions are unsafe, so it is their caller responsibility to be sound
TODO this will only be implemented with macro in future TODO not sure if trait have to be unsafe itself
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