pub struct DynamicallyLinkedUrlSchemePlugin {
pub handle: ManuallyDrop<Box<dyn UrlSchemePlugin>>,
pub library: ManuallyDrop<Library>,
}Expand description
This struct represents a dynamically linked Plugin.
It loads the plugin from a shared library at runtime, storing the handle as a Box<dyn UrlSchemePlugin>.
It’s really important to store the library as well, because once the library is dropped the handle will be invalid.
While for the Node struct we don’t care about the order of the library and the handle, because by design the node will be dropped
before the library, it’s not the case here. And so we need either to use ManuallyDrop or to order the fields in a way that the library is dropped last.
Fields§
§handle: ManuallyDrop<Box<dyn UrlSchemePlugin>>§library: ManuallyDrop<Library>Implementations§
Source§impl DynamicallyLinkedUrlSchemePlugin
impl DynamicallyLinkedUrlSchemePlugin
Sourcepub fn new(handle: Box<dyn UrlSchemePlugin>, library: Library) -> Self
pub fn new(handle: Box<dyn UrlSchemePlugin>, library: Library) -> Self
Create a new DynamicallyLinkedUrlSchemePlugin with the given handle and library.
Use this function to make it easier to create a new DynamicallyLinkedUrlSchemePlugin.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DynamicallyLinkedUrlSchemePlugin
impl !RefUnwindSafe for DynamicallyLinkedUrlSchemePlugin
impl Send for DynamicallyLinkedUrlSchemePlugin
impl Sync for DynamicallyLinkedUrlSchemePlugin
impl Unpin for DynamicallyLinkedUrlSchemePlugin
impl !UnwindSafe for DynamicallyLinkedUrlSchemePlugin
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