CBase

Struct CBase 

Source
pub struct CBase<'interface> { /* private fields */ }
Expand description

Owned emf-core-base interface.

Implementations§

Source§

impl<'interface> CBase<'interface>

Source

pub unsafe fn new(interface: CBaseRef<'interface>) -> Self

Constructs itself using the borrowed interface.

§Safety

This function is unsafe, as it enables bypassing the locking mechanism.

Trait Implementations§

Source§

impl<'interface> CBaseAPILoader<'interface> for CBase<'interface>

Source§

type Interface = CBase<'interface>

Type of the interface.
Source§

unsafe fn fetch_interface( base_module: Option<NonNull<CBaseFFI>>, get_function_fn: GetFunctionFnFFI, ) -> Self::Interface

Fetches the emf-core-base interface. Read more
Source§

impl<'interface> CBaseAccess<'interface> for CBase<'interface>

Source§

type Interface = CBaseRef<'interface>

Type of the interface.
Source§

fn lock<U>(&self, f: impl FnOnce(&mut Self::Interface) -> U) -> U

Enters the critical section with the provided function. Read more
Source§

fn try_lock<U>(&self, f: impl FnOnce(&mut Self::Interface) -> U) -> Option<U>

Enters the critical section with the provided function. Read more
Source§

unsafe fn assume_locked<U>( &self, f: impl FnOnce(&mut Self::Interface) -> U, ) -> U

Enters the critical section with the provided function without locking. Read more
Source§

impl<'interface> CBaseInterfaceInfo for CBase<'interface>

Source§

type Interface = <CBaseRef<'interface> as CBaseInterfaceInfo>::Interface

Type of the interface.
Source§

fn interface_version(&self) -> Version

Returns the version of the interface.
Source§

fn internal_interface(&self) -> &Self::Interface

Fetches the internal low-level interface.
Source§

impl<'interface> Debug for CBase<'interface>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'interface> SysAPIMin<'interface> for CBase<'interface>

Source§

fn panic(&self, error: Option<impl AsRef<CStr>>) -> !

Execution of the program is stopped abruptly. The error may be logged.
Source§

fn has_function<U>(&self) -> bool
where U: FnCaster,

Checks if a function is implemented. Read more
Source§

fn get_function<U>(&self, caster: &U) -> Option<<U as FnCaster>::Type>
where U: FnCaster,

Fetches a function from the interface. Read more
Source§

impl VersionBinding for CBase<'_>

Source§

unsafe fn new_short(&self, major: i32, minor: i32, patch: i32) -> Version

Constructs a new version. Read more
Source§

unsafe fn new_long( &self, major: i32, minor: i32, patch: i32, release_type: ReleaseType, release_number: i8, ) -> Version

Constructs a new version. Read more
Source§

unsafe fn new_full( &self, major: i32, minor: i32, patch: i32, release_type: ReleaseType, release_number: i8, build: i64, ) -> Version

Constructs a new version. Read more
Source§

unsafe fn from_string( &self, buffer: NonNullConst<ConstSpan<u8>>, ) -> Result<Version, Error>

Constructs a version from a string. Read more
Source§

unsafe fn string_length_short(&self, version: NonNullConst<Version>) -> usize

Computes the length of the short version string. Read more
Source§

unsafe fn string_length_long(&self, version: NonNullConst<Version>) -> usize

Computes the length of the long version string. Read more
Source§

unsafe fn string_length_full(&self, version: NonNullConst<Version>) -> usize

Computes the length of the full version string. Read more
Source§

unsafe fn as_string_short( &self, version: NonNullConst<Version>, buffer: NonNull<MutSpan<u8>>, ) -> Result<usize, Error>

Represents the version as a short string. Read more
Source§

unsafe fn as_string_long( &self, version: NonNullConst<Version>, buffer: NonNull<MutSpan<u8>>, ) -> Result<usize, Error>

Represents the version as a long string. Read more
Source§

unsafe fn as_string_full( &self, version: NonNullConst<Version>, buffer: NonNull<MutSpan<u8>>, ) -> Result<usize, Error>

Represents the version as a full string. Read more
Source§

unsafe fn string_is_valid( &self, version_string: NonNullConst<ConstSpan<u8>>, ) -> Bool

Checks whether the version string is valid. Read more
Source§

unsafe fn compare( &self, lhs: NonNullConst<Version>, rhs: NonNullConst<Version>, ) -> i32

Compares two versions. Read more
Source§

unsafe fn compare_weak( &self, lhs: NonNullConst<Version>, rhs: NonNullConst<Version>, ) -> i32

Compares two versions. Read more
Source§

unsafe fn compare_strong( &self, lhs: NonNullConst<Version>, rhs: NonNullConst<Version>, ) -> i32

Compares two versions. Read more
Source§

unsafe fn is_compatible( &self, lhs: NonNullConst<Version>, rhs: NonNullConst<Version>, ) -> Bool

Checks for compatibility of two versions. Read more

Auto Trait Implementations§

§

impl<'interface> !Freeze for CBase<'interface>

§

impl<'interface> !RefUnwindSafe for CBase<'interface>

§

impl<'interface> !Send for CBase<'interface>

§

impl<'interface> !Sync for CBase<'interface>

§

impl<'interface> Unpin for CBase<'interface>

§

impl<'interface> UnwindSafe for CBase<'interface>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> VersionAPI for T
where T: VersionBinding,

Source§

fn new_short(&self, major: i32, minor: i32, patch: i32) -> Version

Constructs a new version. Read more
Source§

fn new_long( &self, major: i32, minor: i32, patch: i32, release_type: ReleaseType, release_number: i8, ) -> Version

Constructs a new version. Read more
Source§

fn new_full( &self, major: i32, minor: i32, patch: i32, release_type: ReleaseType, release_number: i8, build: i64, ) -> Version

Constructs a new version. Read more
Source§

fn from_string(&self, buffer: impl AsRef<str>) -> Result<Version, Error>

Constructs a version from a string. Read more
Source§

fn string_length_short(&self, version: &Version) -> usize

Computes the length of the short version string. Read more
Source§

fn string_length_long(&self, version: &Version) -> usize

Computes the length of the long version string. Read more
Source§

fn string_length_full(&self, version: &Version) -> usize

Computes the length of the full version string. Read more
Source§

fn as_string_short( &self, version: &Version, buffer: impl AsMut<str>, ) -> Result<usize, Error>

Represents the version as a short string. Read more
Source§

fn as_string_long( &self, version: &Version, buffer: impl AsMut<str>, ) -> Result<usize, Error>

Represents the version as a long string. Read more
Source§

fn as_string_full( &self, version: &Version, buffer: impl AsMut<str>, ) -> Result<usize, Error>

Represents the version as a full string. Read more
Source§

fn string_is_valid(&self, version_string: impl AsRef<str>) -> bool

Checks whether the version string is valid. Read more
Source§

fn compare(&self, lhs: &Version, rhs: &Version) -> Ordering

Compares two versions. Read more
Source§

fn compare_weak(&self, lhs: &Version, rhs: &Version) -> Ordering

Compares two versions. Read more
Source§

fn compare_strong(&self, lhs: &Version, rhs: &Version) -> Ordering

Compares two versions. Read more
Source§

fn is_compatible(&self, lhs: &Version, rhs: &Version) -> bool

Checks for compatibility of two versions. Read more