#[repr(C)]pub struct Library<'name, const N: usize> {
pub regs: [Reg; N],
/* private fields */
}Expand description
List of registered C functions to be used with
Thread::new_lib.
The generic const N: usize specifies the static number of entries;
'name indicates the lifetime for every key, which are C strings.
Fields§
§regs: [Reg; N]Implementations§
Source§impl<'name, const N: usize> Library<'name, N>
impl<'name, const N: usize> Library<'name, N>
Sourcepub const fn new(items: [(&'name CStr, Option<CFunction>); N]) -> Self
pub const fn new(items: [(&'name CStr, Option<CFunction>); N]) -> Self
Construct an instance of Library with a static list of functions.
Sourcepub const fn len(&self) -> usize
pub const fn len(&self) -> usize
Return the number of functions registered for this set of functions.
pub const fn is_empty(&self) -> bool
Sourcepub const fn as_reg_slice(&self) -> &[Reg]
pub const fn as_reg_slice(&self) -> &[Reg]
Return a slice of Regs that represent the registered functions.
Trait Implementations§
Source§impl<'name, const N: usize> Ord for Library<'name, N>
impl<'name, const N: usize> Ord for Library<'name, N>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'name, const N: usize> PartialOrd for Library<'name, N>
impl<'name, const N: usize> PartialOrd for Library<'name, N>
impl<'name, const N: usize> Copy for Library<'name, N>
impl<'name, const N: usize> Eq for Library<'name, N>
impl<'name, const N: usize> StructuralPartialEq for Library<'name, N>
Auto Trait Implementations§
impl<'name, const N: usize> Freeze for Library<'name, N>
impl<'name, const N: usize> RefUnwindSafe for Library<'name, N>
impl<'name, const N: usize> !Send for Library<'name, N>
impl<'name, const N: usize> !Sync for Library<'name, N>
impl<'name, const N: usize> Unpin for Library<'name, N>
impl<'name, const N: usize> UnwindSafe for Library<'name, N>
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