#[non_exhaustive]pub struct CallOptions {
pub route: Option<Route>,
pub data_class: Option<DataClass>,
pub approved: Vec<Digest>,
pub marked: Vec<BBox>,
pub region: Option<BBox>,
pub frames: bool,
}Expand description
Per-call options.
§Example
use adk_vision::{CallOptions, Route};
let options = CallOptions::new().with_route(Route::to("gemini")).with_data_class("photo");
assert_eq!(options.data_class.unwrap().as_str(), "photo");Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.route: Option<Route>The route for this call, instead of the task’s configured one.
data_class: Option<DataClass>The data class of images released to a remote backend; image when unset.
approved: Vec<Digest>Egress digests a person approved, for rules that ask.
marked: Vec<BBox>Regions to fill before any release, in source pixels.
region: Option<BBox>Only this region of each image, in source pixels: the backend is sent its crop, and answers come back in source pixels with the crop in their transform chain.
frames: boolMeters each image as a frame of a stream (UsageUnit::Frames) instead of an image
(UsageUnit::Images), so a stream’s frames count against frame caps and quotas
(spec 3.7 X3, §7.9). The stream pipeline sets it on every detector call.
Implementations§
Source§impl CallOptions
impl CallOptions
Sourcepub fn with_route(self, route: Route) -> Self
pub fn with_route(self, route: Route) -> Self
Routes this call.
Sourcepub fn with_data_class(self, class: impl Into<String>) -> Self
pub fn with_data_class(self, class: impl Into<String>) -> Self
Sets the data class.
Sourcepub fn with_marked(self, regions: Vec<BBox>) -> Self
pub fn with_marked(self, regions: Vec<BBox>) -> Self
Marks regions for redaction.
Sourcepub fn with_region(self, region: BBox) -> Self
pub fn with_region(self, region: BBox) -> Self
Works on region of each image only; a remote backend is sent nothing else.
Sourcepub fn as_frames(self) -> Self
pub fn as_frames(self) -> Self
Meters each image as a stream frame: units go to UsageUnit::Frames, and a backend
priced per image is billed one unit per frame.
§Example
use adk_core::UsageUnit;
use adk_vision::CallOptions;
assert_eq!(CallOptions::new().image_unit(), UsageUnit::Images);
assert_eq!(CallOptions::new().as_frames().image_unit(), UsageUnit::Frames);Sourcepub fn image_unit(&self) -> UsageUnit
pub fn image_unit(&self) -> UsageUnit
The unit each image of the call is metered in: UsageUnit::Frames for a stream’s
frames (as_frames), UsageUnit::Images otherwise.
Trait Implementations§
Source§impl Clone for CallOptions
impl Clone for CallOptions
Source§impl Debug for CallOptions
impl Debug for CallOptions
Source§impl Default for CallOptions
impl Default for CallOptions
Source§impl PartialEq for CallOptions
impl PartialEq for CallOptions
impl StructuralPartialEq for CallOptions
Auto Trait Implementations§
impl Forget for CallOptions
impl Freeze for CallOptionswhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Trigger>: Freeze,
PhantomData<Digest>: Freeze,
PhantomData<BBox>: Freeze,
impl Move for CallOptions
impl RefUnwindSafe for CallOptions
impl Send for CallOptionswhere
RawVecInner: Send,
impl Sync for CallOptionswhere
RawVecInner: Sync,
impl Unpin for CallOptions
impl UnsafeUnpin for CallOptionswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Trigger>: UnsafeUnpin,
PhantomData<Digest>: UnsafeUnpin,
PhantomData<BBox>: UnsafeUnpin,
impl UnwindSafe for CallOptionswhere
RawVecInner: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for T
impl<T> Downcast for T
impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
impl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().impl<T> Scalar for T
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.