Struct swipl::callable::LazyCallablePredicate
source · pub struct LazyCallablePredicate<const N: usize> { /* private fields */ }
Expand description
Looks up a predicate on first call to as_callable
and keeps it cached afterwards.
This is used by both the prolog!
macro and the pred!
macro to
only look up a predicate once.
Implementations§
source§impl<const N: usize> LazyCallablePredicate<N>
impl<const N: usize> LazyCallablePredicate<N>
sourcepub const fn new(module: Option<&'static str>, name: &'static str) -> Self
pub const fn new(module: Option<&'static str>, name: &'static str) -> Self
Create a new LazyCallablepredicate
from a module, a name, and the const type argument which is used as arity.
sourcepub fn as_callable(&self) -> CallablePredicate<N>
pub fn as_callable(&self) -> CallablePredicate<N>
Return a CallablePredicate
from the information in this struct.
If this was previously called for this struct, it’ll return what it previously looked up. Otherwise, it’ll do the lookup.
Trait Implementations§
source§impl<'a, const N: usize> Callable<N> for &'a LazyCallablePredicate<N>
impl<'a, const N: usize> Callable<N> for &'a LazyCallablePredicate<N>
Auto Trait Implementations§
impl<const N: usize> RefUnwindSafe for LazyCallablePredicate<N>
impl<const N: usize> Send for LazyCallablePredicate<N>
impl<const N: usize> Sync for LazyCallablePredicate<N>
impl<const N: usize> Unpin for LazyCallablePredicate<N>
impl<const N: usize> UnwindSafe for LazyCallablePredicate<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