Trait emf_core_base_rs::CBaseAccess[][src]

pub trait CBaseAccess<'interface> {
    type Interface: CBaseAPI<'interface>;
    fn lock<U>(&self, f: impl FnOnce(&mut Self::Interface) -> U) -> U;
fn try_lock<U>(
        &self,
        f: impl FnOnce(&mut Self::Interface) -> U
    ) -> Option<U>;
unsafe fn assume_locked<U>(
        &self,
        f: impl FnOnce(&mut Self::Interface) -> U
    ) -> U; }

A trait that provides access to the interface.

Associated Types

type Interface: CBaseAPI<'interface>[src]

Type of the interface.

Loading content...

Required methods

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

Enters the critical section with the provided function.

The calling thread will wait until it can acquire the lock.

Return

Return value from the provided function.

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

Enters the critical section with the provided function.

The function does nothing if the lock could not be acquired.

Return

Return value from the provided function or Option::None if the lock could not be acquired.

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

Enters the critical section with the provided function without locking.

Return

Return value from the provided function.

Safety

Most of the interface assumes that the caller has unique access to the interface. This function can be used to bypass this restriction, if the user can guarantee that no data-races will occur.

Loading content...

Implementors

impl<'interface> CBaseAccess<'interface> for CBase<'interface>[src]

type Interface = CBaseRef<'interface>

Loading content...