pub struct FakeVisionRunner { /* private fields */ }Expand description
Local runner that maps synthetic image references to scripted vision output.
Implementations§
Source§impl FakeVisionRunner
impl FakeVisionRunner
Sourcepub fn new(model: impl Into<String>) -> Self
pub fn new(model: impl Into<String>) -> Self
Creates an empty fake vision runner for the named model surface.
Sourcepub fn with_fixture(
self,
reference: impl Into<String>,
fixture: FakeVisionFixture,
) -> Result<Self>
pub fn with_fixture( self, reference: impl Into<String>, fixture: FakeVisionFixture, ) -> Result<Self>
Adds one synthetic image fixture.
Sourcepub fn fixture(&self, reference: &str) -> Option<&FakeVisionFixture>
pub fn fixture(&self, reference: &str) -> Option<&FakeVisionFixture>
Returns a fixture by reference.
Trait Implementations§
Source§impl Clone for FakeVisionRunner
impl Clone for FakeVisionRunner
Source§fn clone(&self) -> FakeVisionRunner
fn clone(&self) -> FakeVisionRunner
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FakeVisionRunner
impl Debug for FakeVisionRunner
Source§impl ModelRunner for FakeVisionRunner
impl ModelRunner for FakeVisionRunner
Source§fn card(&self) -> ModelCard
fn card(&self) -> ModelCard
Returns metadata describing the runner’s advertised model surface.
Source§fn infer(&self, _cx: &mut Cx, request: ModelRequest) -> Result<ModelResponse>
fn infer(&self, _cx: &mut Cx, request: ModelRequest) -> Result<ModelResponse>
Executes one non-streaming inference request.
Source§fn infer_stream(
&self,
cx: &mut Cx,
request: ModelRequest,
sink: &mut dyn ModelEventSink,
) -> Result<ModelResponse, Error>
fn infer_stream( &self, cx: &mut Cx, request: ModelRequest, sink: &mut dyn ModelEventSink, ) -> Result<ModelResponse, Error>
Executes one streaming inference request. Read more
Auto Trait Implementations§
impl Freeze for FakeVisionRunner
impl RefUnwindSafe for FakeVisionRunner
impl Send for FakeVisionRunner
impl Sync for FakeVisionRunner
impl Unpin for FakeVisionRunner
impl UnsafeUnpin for FakeVisionRunner
impl UnwindSafe for FakeVisionRunner
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