pub enum AmacGroupKey {
SessionRead,
SessionWrite,
EventRead,
EventWrite,
Tool,
Exec,
Http,
Ui,
Log,
}Expand description
Grouping key for batching compatible hostcall requests together.
Variants§
SessionRead
Session read operations (get_state, get_messages, etc.) - highly batchable.
SessionWrite
Session write operations (set_model, set_name, etc.) - must preserve order.
EventRead
Event queries (get_model, get_flag, list_flags) - batchable.
EventWrite
Event mutations (set_model, register_*) - preserve order.
Tool
Tool invocations - independent, can interleave.
Exec
Exec invocations - independent but may have side effects.
Http
HTTP requests - independent, high latency → good AMAC candidates.
Ui
UI operations - typically sequential.
Log
Log operations - fire-and-forget, trivially batchable.
Implementations§
Source§impl AmacGroupKey
impl AmacGroupKey
Sourcepub fn from_request(request: &HostcallRequest) -> Self
pub fn from_request(request: &HostcallRequest) -> Self
Classify a hostcall request into its batch group.
Sourcepub const fn interleave_safe(&self) -> bool
pub const fn interleave_safe(&self) -> bool
Whether requests in this group are safe to interleave (no ordering dependencies within the group).
Sourcepub const fn memory_weight(&self) -> u32
pub const fn memory_weight(&self) -> u32
Estimated memory-boundedness weight for this group (0..100). Higher means more likely to benefit from interleaving.
Trait Implementations§
Source§impl Clone for AmacGroupKey
impl Clone for AmacGroupKey
Source§fn clone(&self) -> AmacGroupKey
fn clone(&self) -> AmacGroupKey
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AmacGroupKey
impl Debug for AmacGroupKey
Source§impl<'de> Deserialize<'de> for AmacGroupKey
impl<'de> Deserialize<'de> for AmacGroupKey
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for AmacGroupKey
impl Hash for AmacGroupKey
Source§impl Ord for AmacGroupKey
impl Ord for AmacGroupKey
Source§fn cmp(&self, other: &AmacGroupKey) -> Ordering
fn cmp(&self, other: &AmacGroupKey) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for AmacGroupKey
impl PartialEq for AmacGroupKey
Source§impl PartialOrd for AmacGroupKey
impl PartialOrd for AmacGroupKey
Source§impl Serialize for AmacGroupKey
impl Serialize for AmacGroupKey
impl Eq for AmacGroupKey
impl StructuralPartialEq for AmacGroupKey
Auto Trait Implementations§
impl Freeze for AmacGroupKey
impl RefUnwindSafe for AmacGroupKey
impl Send for AmacGroupKey
impl Sync for AmacGroupKey
impl Unpin for AmacGroupKey
impl UnsafeUnpin for AmacGroupKey
impl UnwindSafe for AmacGroupKey
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
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>
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>
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