pub struct Model {
pub id: String,
pub display_name: Option<String>,
}Expand description
A model an endpoint offers.
Fields§
§id: StringThe identifier to put in drep.toml.
display_name: Option<String>A human-facing name, when the endpoint sends one. Kimi’s k3 is
"K2.7 Coding", which is worth showing beside the id nobody would guess
it from.
Implementations§
Source§impl Model
impl Model
Sourcepub fn label(&self) -> String
pub fn label(&self) -> String
How the wizard lists this model: the id, plus the vendor’s own name for it when that differs.
Through crate::text::excerpt, because both halves are the
endpoint’s text and this goes straight to the terminal. Parsing the
listing already refuses an id with a control character in it, but
display_name is shown, never stored, so it is cleaned here rather
than refused there.
Trait Implementations§
impl Eq for Model
impl StructuralPartialEq for Model
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnsafeUnpin for Model
impl UnwindSafe for Model
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<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
Compare self to
key and return true if they are equal.