Skip to main content

MockEngine

Struct MockEngine 

Source
pub struct MockEngine { /* private fields */ }

Implementations§

Source§

impl MockEngine

Source

pub fn new(cfg: EngineConfig) -> MockEngine

Source

pub fn refusing_admits( self, refuse: fn(&LaneAdmit) -> bool, status: Status, ) -> MockEngine

Source

pub fn with_capability_descriptor(self, record: impl Into<String>) -> MockEngine

Source

pub fn config(&self) -> &EngineConfig

Source

pub fn bundle_fingerprint(&self) -> u64

Source

pub fn lane_sequence(&self, lane_tag: u64) -> Option<SeqHandle>

Source

pub fn lane_committed(&self, lane_tag: u64) -> Option<&[u32]>

Source

pub fn create_sequence(&mut self) -> SeqHandle

Source

pub fn space_valid_len(&self, seq: SeqHandle, space_id: u32) -> Option<u64>

Source

pub fn space_taint(&self, seq: SeqHandle, space_id: u32) -> Option<u32>

Source

pub fn pool_used(&self) -> u64

Source

pub fn force_finish(&mut self, lane_tag: u64, finish: u32)

Source

pub fn inject_fault(&mut self, lane_tag: u64, code: u32)

Source

pub fn grant_certs_for_test(&mut self, strategy_id: &str, certs: Vec<Cert>)

Source

pub fn make_cert( &mut self, exactness: u8, sampling_modes: u8, param_domain: u32, grammar_allowed: bool, admissible_host_identities: Vec<[u8; 32]>, ) -> Cert

Trait Implementations§

Source§

impl Engine for MockEngine

Source§

fn capability_descriptor(&self) -> Option<String>

Source§

fn embed(&mut self, tokens: &[u32]) -> Result<Vec<f32>, Status>

Source§

fn logit_bias_create( &mut self, tokens: &[i32], values: &[f32], ) -> Result<u32, Status>

Source§

fn logit_bias_free(&mut self, _handle: u32) -> Result<(), Status>

Source§

fn transcribe( &mut self, _audio_path: &str, params: &TranscribeParams, on_segment: Option<SegmentSink<'_>>, ) -> Result<Transcription, Status>

Source§

fn lora_load(&mut self, _adapter_path: &str) -> Result<(), Status>

Source§

fn lora_unload(&mut self) -> Result<(), Status>

Source§

fn tick<'a>( &'a mut self, plan: &TickPlan, arena: &RecordArena, rings: &mut dyn Rings, ) -> Result<&'a TickEvents, Status>

Source§

fn pump(&mut self)

Source§

fn state_spaces(&self) -> &[StateSpaceDesc]

Source§

fn grammar_create(&mut self, json_schema: &str) -> Result<u32, Status>

Source§

fn grammar_create_structural(&mut self, tag_json: &str) -> Result<u32, Status>

Source§

fn grammar_free(&mut self, handle: u32) -> Result<(), Status>

Source§

fn strategy_register( &mut self, reg: &StrategyRegistration, ) -> Result<&StrategyGrant, Status>

Source§

fn space_match( &mut self, space_id: u32, span_tokens: &[u32], _media_deps: &[[u8; 32]], ) -> Result<&MatchResult, Status>

Source§

fn seed_acquire( &mut self, span_tokens: &[u32], prefix_len: u64, determinism_class: u8, ) -> Result<u64, Status>

Source§

fn media_probe(&mut self, _image_path: &str) -> Result<MediaInfo, Status>

Source§

fn media_encode(&mut self, image_path: &str) -> Result<(u64, MediaInfo), Status>

Source§

fn media_release(&mut self, media_handle: u64) -> Result<(), Status>

Source§

fn media_bind( &mut self, lane_tag: u64, media_handle: u64, token_offset: u32, ) -> Result<(), Status>

Source§

fn seed_adopt( &mut self, seq: SeqHandle, span_tokens: &[u32], ) -> Result<u64, Status>

Source§

fn seed_lease_ticks(&self) -> Option<u64>

Source§

fn seed_release(&mut self, seed_handle: u64) -> Result<(), Status>

Source§

fn seq_fork( &mut self, parent: SeqHandle, _flags: u32, ) -> Result<SeqHandle, Status>

Source§

fn lane_sequence(&self, lane_tag: u64) -> Option<SeqHandle>

Source§

fn create_sequence(&mut self) -> Result<SeqHandle, Status>

Source§

fn free_sequence(&mut self, seq: SeqHandle) -> Result<(), Status>

Source§

fn publish_sequence( &mut self, seq: SeqHandle, tokens: &[u32], ) -> Result<(), Status>

Source§

fn space_export_size( &mut self, seq: SeqHandle, space_id: u32, range: TokenRange, encoding: u8, ) -> Result<(u64, u64), Status>

Source§

fn space_snapshot( &mut self, seq: SeqHandle, space_id: u32, boundary_pos: u64, dst_len: u64, sizing_gen: u64, ) -> Result<OpHandle, Status>

Source§

fn space_snapshot_boundary( &mut self, seq: SeqHandle, space_id: u32, cap: u64, ) -> Result<u64, Status>

Source§

fn space_restore( &mut self, seq: SeqHandle, space_id: u32, src: &[u8], ) -> Result<OpHandle, Status>

Source§

fn space_trim( &mut self, seq: SeqHandle, space_id: u32, new_len: u64, ) -> Result<(), Status>

Source§

fn space_demote( &mut self, seq: SeqHandle, space_id: u32, range: TokenRange, encoding: u8, dst_len: u64, sizing_gen: u64, ) -> Result<OpHandle, Status>

Source§

fn space_promote( &mut self, seq: SeqHandle, space_id: u32, _range: TokenRange, src: &[u8], ) -> Result<OpHandle, Status>

Source§

fn op_poll(&mut self, op: OpHandle) -> Result<OpStatus, Status>

Source§

fn take_op_output(&mut self, op: OpHandle) -> Option<Vec<u8>>

Source§

fn n_layers(&self) -> u32

Source§

fn forward_stage( &mut self, tokens: &[u32], start_layer: u32, end_layer: u32, hidden_in: Option<Vec<u8>>, ) -> Result<StageOutput, Status>

Source§

fn op_cancel(&mut self, op: OpHandle) -> Result<(), Status>

Source§

fn cache_evict( &mut self, evictable_cache_classes: u64, protected_quota_bytes: u64, max_evict_bytes: u64, bytes_target: u64, ) -> Result<u64, Status>

Source§

fn attach_ring(&mut self, _ring: &RingAttachment) -> Result<(), Status>

Source§

fn kv_bits(&self) -> u32

Source§

fn space_match_ref( &mut self, space_id: u32, _span: &TokenRef, span_tokens: &[u32], media_deps: &[[u8; 32]], ) -> Result<&MatchResult, Status>

Source§

fn seed_acquire_ref( &mut self, _span: &TokenRef, span_tokens: &[u32], prefix_len: u64, determinism_class: u8, ) -> Result<u64, Status>

Source§

fn seed_adopt_ref( &mut self, seq: SeqHandle, _span: &TokenRef, span_tokens: &[u32], ) -> Result<u64, Status>

Source§

fn lora_id(&self) -> Option<String>

Source§

fn unpublish(&mut self, _tokens: &[u32]) -> Result<(), Status>

Drops the prefix-cache entry published under exactly tokens, unless a seed holds it; none there is not an error.
Source§

fn cache_evict_entries( &mut self, _keys: &[([u8; 32], [u8; 32])], ) -> Result<(), Status>

Source§

impl EngineInspect for MockEngine

Source§

fn lane_committed(&self, lane_tag: u64) -> Option<&[u32]>

Source§

fn inject_fault(&mut self, lane_tag: u64, code: u32)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.