pub struct LookupBus {
pub index: BusIndex,
}
Expand description
A Lookup
bus is used to establish that one multiset of values (the queries) are subset of
another multiset of values (the keys).
Soundness requires that the total number of queries sent over the bus per message is at most the field characteristic.
Fields§
§index: BusIndex
Implementations§
Source§impl LookupBus
impl LookupBus
pub const fn new(index: BusIndex) -> Self
Sourcepub fn lookup_key<AB, E>(
&self,
builder: &mut AB,
query: impl IntoIterator<Item = E>,
enabled: impl Into<AB::Expr>,
)
pub fn lookup_key<AB, E>( &self, builder: &mut AB, query: impl IntoIterator<Item = E>, enabled: impl Into<AB::Expr>, )
Performs a lookup on the given bus.
This method asserts that key
is present in the lookup table. The parameter enabled
must be constrained to be boolean, and the lookup constraint is imposed provided enabled
is one.
Caller must constrain that enabled
is boolean.
Sourcepub fn add_key_with_lookups<AB, E>(
&self,
builder: &mut AB,
key: impl IntoIterator<Item = E>,
num_lookups: impl Into<AB::Expr>,
)
pub fn add_key_with_lookups<AB, E>( &self, builder: &mut AB, key: impl IntoIterator<Item = E>, num_lookups: impl Into<AB::Expr>, )
Adds a key to the lookup table.
The num_lookups
parameter should equal the number of enabled lookups performed.
Trait Implementations§
impl Copy for LookupBus
impl Eq for LookupBus
impl StructuralPartialEq for LookupBus
Auto Trait Implementations§
impl Freeze for LookupBus
impl RefUnwindSafe for LookupBus
impl Send for LookupBus
impl Sync for LookupBus
impl Unpin for LookupBus
impl UnwindSafe for LookupBus
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more