#[non_exhaustive]pub enum LoadOrigin {
Mapped,
AlreadyResident,
Unknown,
}Expand description
What a Plugin::load did to the library it names.
dlopen refcounts by path, so a load either maps the library or reaches a
copy the process already had. Both produce a working Plugin, and without
this they are indistinguishable in every observable one has — which is how a
hot-reload endpoint comes to report success for a load that read no file.
#[non_exhaustive] because the set of answers is the loader’s, not this
crate’s.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Mapped
The load mapped the library: the file was read and, if the plugin exports one, its initializer ran for the first time.
AlreadyResident
The library was already resident. No file was read, no initializer ran, and a binary rebuilt in place at that path was not picked up.
Not an error: the handle works, and it shares the plugin’s state and initialization with every other handle to the same path. It is the load that was a no-op, which is the thing a host needs to be able to say.
Unknown
This platform’s dynamic loader cannot be asked.
The probe is RTLD_NOLOAD, which POSIX does not require and which
OpenBSD, Haiku, AIX and VxWorks do not provide. Everywhere this crate is
built and tested — Linux, macOS, the BSDs that have the flag, and Windows
via GetModuleHandleExW — answers Mapped or
AlreadyResident.
A host should report it as “cannot tell” rather than folding it into either answer; that is the whole reason it is a variant instead of a convenient default.
Trait Implementations§
Source§impl Clone for LoadOrigin
impl Clone for LoadOrigin
impl Copy for LoadOrigin
Source§impl Debug for LoadOrigin
impl Debug for LoadOrigin
impl Eq for LoadOrigin
Source§impl PartialEq for LoadOrigin
impl PartialEq for LoadOrigin
impl StructuralPartialEq for LoadOrigin
Auto Trait Implementations§
impl Freeze for LoadOrigin
impl RefUnwindSafe for LoadOrigin
impl Send for LoadOrigin
impl Sync for LoadOrigin
impl Unpin for LoadOrigin
impl UnsafeUnpin for LoadOrigin
impl UnwindSafe for LoadOrigin
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.