Skip to main content

AprV2Flags

Struct AprV2Flags 

Source
pub struct AprV2Flags(/* private fields */);
Expand description

APR v2 feature flags (16-bit for expanded feature set)

Implementations§

Source§

impl AprV2Flags

Source

pub const LZ4_COMPRESSED: u16 = 0b0000_0000_0000_0001

Payload is compressed with LZ4

Source

pub const ZSTD_COMPRESSED: u16 = 0b0000_0000_0000_0010

Payload is compressed with Zstd

Source

pub const ENCRYPTED: u16 = 0b0000_0000_0000_0100

Payload is encrypted (AES-256-GCM)

Source

pub const SIGNED: u16 = 0b0000_0000_0000_1000

Has digital signature (Ed25519)

Source

pub const SHARDED: u16 = 0b0000_0000_0001_0000

Model is sharded across multiple files

Source

pub const QUANTIZED: u16 = 0b0000_0000_0010_0000

Tensors are quantized

Source

pub const HAS_FILTERBANK: u16 = 0b0000_0000_0100_0000

Has embedded filterbank (for Whisper models)

Source

pub const HAS_MODEL_CARD: u16 = 0b0000_0000_1000_0000

Has model card metadata

Source

pub const STREAMING: u16 = 0b0000_0001_0000_0000

Supports streaming/chunked loading

Source

pub const HAS_VOCAB: u16 = 0b0000_0010_0000_0000

Contains vocabulary/tokenizer

Source

pub const LAYOUT_ROW_MAJOR: u16 = 0b0000_0100_0000_0000

LAYOUT-002: Tensor layout is row-major (REQUIRED for valid APR files) All APR files created after LAYOUT-002 must have this flag set. Pre-LAYOUT-002 files without this flag are assumed row-major.

Source

pub const LAYOUT_COLUMN_MAJOR: u16 = 0b0000_1000_0000_0000

LAYOUT-002: Tensor layout is column-major (FORBIDDEN - Jidoka guard) If this flag is set, the APR file is “dirty” and must be rejected. This flag exists to catch improperly converted GGUF files.

Source

pub const fn new() -> AprV2Flags

Create new empty flags

Source

pub const fn from_bits(bits: u16) -> AprV2Flags

Create from raw u16 value

Source

pub const fn bits(self) -> u16

Get raw bits

Source

pub const fn contains(self, flag: u16) -> bool

Check if flag is set

Source

pub const fn with(self, flag: u16) -> AprV2Flags

Set a flag

Source

pub const fn without(self, flag: u16) -> AprV2Flags

Clear a flag

Source

pub const fn is_lz4_compressed(self) -> bool

Check if LZ4 compressed

Source

pub const fn is_zstd_compressed(self) -> bool

Check if Zstd compressed

Source

pub const fn is_encrypted(self) -> bool

Check if encrypted

Source

pub const fn is_sharded(self) -> bool

Check if sharded

Source

pub const fn is_quantized(self) -> bool

Check if quantized

Source

pub const fn is_row_major(self) -> bool

LAYOUT-002: Check if row-major layout flag is set

Source

pub const fn is_column_major(self) -> bool

LAYOUT-002: Check if column-major layout flag is set (should be rejected)

Source

pub const fn is_layout_valid(self) -> bool

LAYOUT-002: Validate layout is safe for inference Returns true if the file is row-major or pre-LAYOUT-002 (assumed row-major) Returns false if explicitly marked as column-major (dirty APR file)

Trait Implementations§

Source§

impl Clone for AprV2Flags

Source§

fn clone(&self) -> AprV2Flags

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for AprV2Flags

Source§

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

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

impl Default for AprV2Flags

Source§

fn default() -> AprV2Flags

Returns the “default value” for a type. Read more
Source§

impl PartialEq for AprV2Flags

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 Copy for AprV2Flags

Source§

impl Eq for AprV2Flags

Source§

impl StructuralPartialEq for AprV2Flags

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

Source§

fn downcast(&self) -> &T

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,