Skip to main content

VerifyOk

Struct VerifyOk 

Source
#[non_exhaustive]
pub struct VerifyOk { pub latency_ms: u32, pub models: Vec<String>, pub dropped: usize, pub dropped_models: Vec<String>, pub model_in_list: bool, pub limits: Option<TokenLimits>, pub model_limits: Vec<(String, TokenLimits)>, }
Expand description

验证成功的结果。

带 Serialize 是为了能直接从 Tauri Command 返回 —— 与 crate::VerifyError 成对,调用方的成功/失败两条路径都不必再写一遍 DTO。 字段名转 camelCase,与 crate::ProviderPreset 等喂给界面的类型保持一致。

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§latency_ms: u32

往返耗时 —— UI 显示「正常 · 320ms」,中转站慢不慢一眼看出

§models: Vec<String>

端点返回的可对话模型清单(已去重 + 清洗)

§dropped: usize

清洗时滤掉的条数(向量 / 重排 / 语音 / OCR 等非对话模型)。

用途是「已滤掉 N 个向量 / 重排 / 语音等」这类提示文案 —— 让用户知道 清单被处理过,而不是以为这个端点就这么几个模型。聚合平台上这个数字很大 (OpenRouter 实测 433 条里滤掉相当一部分),不说明会让人以为拉漏了。

全被滤光时本字段为 0 且 models 是未过滤的原始清单 —— 那说明特征词 在这个端点上判错了,此时宁可把原始清单摆给用户看,也不给他一个空下拉。

§dropped_models: Vec<String>

被滤掉的模型 id(端点顺序),len() == dropped。

只给「一个配置同时挂对话与生图 / 配音 / 向量模型」的调用方用 —— 把它们接在 models 后面,而不是丢掉。只做对话的调用方忽略它即可。

§model_in_list: bool

当前填的 model 是否在清单里;model 为空或端点没返回清单时为 true

§limits: Option<TokenLimits>

🔴 当前填的那个模型的限额,由端点上报(source: Endpoint)。

None 有两种情况,调用方处理方式相同 —— 回落到 ModelOption::preset_limits:

  • 端点没报(OpenAI 规范里就没有 context 字段,是常态)
  • 当前 model 不在端点返回的清单里
§model_limits: Vec<(String, TokenLimits)>

端点上报了限额的全部模型,(id, 限额)。

给「切换模型时立刻显示新窗口」这类场景用 —— 不必为换个模型再打一次端点。 端点不报限额时是空表。

Trait Implementations§

Source§

impl Clone for VerifyOk

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VerifyOk

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for VerifyOk

Source§

impl PartialEq for VerifyOk

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for VerifyOk

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for VerifyOk

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more