[][src]Trait flize::Shield

pub trait Shield<'a>: Clone + Debug {
    pub fn repin(&mut self);
pub fn repin_after<F, R>(&mut self, f: F) -> R
    where
        F: FnOnce() -> R
;
pub fn retire<F>(&self, f: F)
    where
        F: FnOnce() + 'a
;
pub fn flush(&self); }

Universal methods for any shield implementation.

Required methods

pub fn repin(&mut self)[src]

Attempt to synchronize the current thread to allow advancing the global epoch. This might be useful to call every once in a while if you plan on holding a Shield for an extended amount of time as to not stop garbage collection.

This is only effective if this is the only active shield created by this thread. Has no effect when called from an unprotected shield.

pub fn repin_after<F, R>(&mut self, f: F) -> R where
    F: FnOnce() -> R, 
[src]

Attempt to synchronize the current thread like Shield::repin but executing a closure during the time the Shield is temporarily deactivated.

If this method is called from an unprotected shield, the closure will be executed immediately without unpinning the thread.

pub fn retire<F>(&self, f: F) where
    F: FnOnce() + 'a, 
[src]

Schedule a closure for execution once no shield may hold a reference to an object unlinked with the current shield.

If this method is called from an unprotected shield, the closure will be executed immediately.

pub fn flush(&self)[src]

Moves all deferred functions in the queue associated with the shield to the one associated with the collector.

Loading content...

Implementors

impl<'a> Shield<'a> for FullShield<'a>[src]

impl<'a> Shield<'a> for ThinShield<'a>[src]

impl<'a> Shield<'a> for UnprotectedShield[src]

Loading content...