pub struct Symbol<'a, T> { /* private fields */ }Available on crate feature
module only.Expand description
This represents a symbol from a Library.
Implementations§
Source§impl<'a, T> Symbol<'a, T>
impl<'a, T> Symbol<'a, T>
Sourcepub unsafe fn as_static(&self) -> Symbol<'static, T>
pub unsafe fn as_static(&self) -> Symbol<'static, T>
Creates a static reference to a symbol.
§Safety
This function assumes that the matching Library this symbol originates from will never ever be dropped/unloaded before using the produced static symbol. If the returned symbol is used after dropping the matching Library this symbol originated from, this is UB.
This is best ensured using a ModuleLoader rather than messing with Library manually.
Auto Trait Implementations§
impl<'a, T> Freeze for Symbol<'a, T>
impl<'a, T> RefUnwindSafe for Symbol<'a, T>where
T: RefUnwindSafe,
impl<'a, T> !Send for Symbol<'a, T>
impl<'a, T> !Sync for Symbol<'a, T>
impl<'a, T> Unpin for Symbol<'a, T>
impl<'a, T> UnwindSafe for Symbol<'a, T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more