Skip to main content

RuntimeCapabilities

Struct RuntimeCapabilities 

Source
pub struct RuntimeCapabilities {
    pub build: Option<u32>,
    pub commit: Option<String>,
    pub version_line: String,
    pub flags: RuntimeFlags,
}
Expand description

What the llama-server binary underneath gglib is, and what it can do.

Fields§

§build: Option<u32>

llama.cpp build number (the 9656 of tag b9656), when it could be determined.

None for a binary whose version output this module does not recognise — a source build with a modified banner, a wrapper script, a future format — and for an unnumbered source build, whose sentinel 1 is rejected by MIN_PLAUSIBLE_BUILD. Recorded rather than guessed.

§commit: Option<String>

The commit sha the banner reported, when it carried one.

For a numbered release this is redundant with Self::build. For an unnumbered source build it is the only identity available, which is why it is captured separately rather than left inside Self::version_line: a stored request record naming a sha can be resolved against upstream history later, and one naming version: 1 cannot.

§version_line: String

The raw version line as the binary reported it.

Kept verbatim even when Self::build parsed cleanly, because it is the only artifact that lets a stored request record be re-interpreted after this module learns to read a format it could not read before.

§flags: RuntimeFlags

Capabilities derived from Self::build.

Implementations§

Source§

impl RuntimeCapabilities

Source

pub fn unknown(version_line: impl Into<String>) -> Self

An unidentified runtime: no build, no flags, every compensation on.

Source

pub fn from_build(build: u32, version_line: impl Into<String>) -> Self

Derive capabilities from a build number.

The single place a build number becomes a capability set, so a threshold is stated once and every caller agrees about it.

A build under MIN_PLAUSIBLE_BUILD is an unnumbered source build and yields Self::unknown — the conservative answer, and the only honest one, since such a binary could be any commit at all.

Source

pub fn from_version_output(output: &str) -> Self

Parse a llama-server version banner into capabilities, falling back to Self::unknown when no build number can be read.

Source

pub const fn has(&self, flag: RuntimeFlags) -> bool

Whether this runtime has flag.

Always false for an unidentified runtime, which is what keeps “unknown” and “absent” behaving identically at call sites without every call site having to remember the distinction.

Source

pub const fn is_identified(&self) -> bool

Whether the runtime was identified at all.

Trait Implementations§

Source§

impl Clone for RuntimeCapabilities

Source§

fn clone(&self) -> RuntimeCapabilities

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 RuntimeCapabilities

Source§

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

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

impl<'de> Deserialize<'de> for RuntimeCapabilities

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for RuntimeCapabilities

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for RuntimeCapabilities

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 Eq for RuntimeCapabilities

Source§

impl StructuralPartialEq for RuntimeCapabilities

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.

§

impl<T> Instrument for T

§

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

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

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> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,