[−][src]Struct relative::Vtable
Wraps &'static
references to vtables such that they can be safely sent
between other processes running the same binary.
For references into the segment that houses the vtables, typically the read-only data segment aka rodata.
The base used is the vtable of a static trait object:
#[used] #[no_mangle] pub static RELATIVE_VTABLE_BASE: &(dyn Any + Sync) = &(); let base = transmute::<*const dyn Any, std::raw::TraitObject>(RELATIVE_VTABLE_BASE).vtable as usize;
Methods
impl<T: ?Sized> Vtable<T>
[src]
pub unsafe fn from(ptr: &'static ()) -> Self
[src]
Create a Vtable<T>
from a &'static ()
.
Safety
This is unsafe as it is up to the user to ensure the pointer lies within static memory.
i.e. the pointer needs to be positioned the same relative to the base in every invocation, through e.g. being in the same segment, or the binary being statically linked.
pub fn to(&self) -> &'static ()
[src]
Get back a &'static ()
from a Vtable<T>
.
Trait Implementations
impl<T: ?Sized> Clone for Vtable<T>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: ?Sized> Copy for Vtable<T>
[src]
impl<T: ?Sized> Eq for Vtable<T>
[src]
impl<T: ?Sized> Ord for Vtable<T>
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<T: ?Sized> PartialEq<Vtable<T>> for Vtable<T>
[src]
impl<T: ?Sized> PartialOrd<Vtable<T>> for Vtable<T>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T: ?Sized> Debug for Vtable<T>
[src]
impl<T: ?Sized> Hash for Vtable<T>
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: ?Sized + 'static> Serialize for Vtable<T>
[src]
impl<'de, T: ?Sized + 'static> Deserialize<'de> for Vtable<T>
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Auto Trait Implementations
impl<T: ?Sized> Send for Vtable<T>
impl<T: ?Sized> Sync for Vtable<T>
impl<T: ?Sized> Unpin for Vtable<T>
impl<T: ?Sized> UnwindSafe for Vtable<T>
impl<T: ?Sized> RefUnwindSafe for Vtable<T>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> Same<T> for T
type Output = T
Should always be Self