pub struct PreparedModelInput<Tensor> { /* private fields */ }Expand description
Backend-neutral prepared input that owns backend-native tensor handles.
The identity is validated at construction and remains coupled to the exact ordered payload and metadata values used by runtime and distributed paths.
Implementations§
Source§impl<Tensor> PreparedModelInput<Tensor>
impl<Tensor> PreparedModelInput<Tensor>
Sourcepub fn new(
parts: Vec<PreparedInputPart<Tensor>>,
describe: impl Fn(&Tensor) -> Result<InputTensorIdentity, PreparedInputError>,
) -> Result<Self, PreparedInputError>
pub fn new( parts: Vec<PreparedInputPart<Tensor>>, describe: impl Fn(&Tensor) -> Result<InputTensorIdentity, PreparedInputError>, ) -> Result<Self, PreparedInputError>
Validates and owns ordered prepared input parts.
Sourcepub const fn identity(&self) -> &PreparedInputIdentity
pub const fn identity(&self) -> &PreparedInputIdentity
Exact payload-free identity used for rank agreement and persistence.
Sourcepub fn cache_identity(
&self,
semantic_content_fingerprint: impl Into<String>,
) -> Result<PreparedInputCacheIdentity, PreparedInputCacheIdentityError>
pub fn cache_identity( &self, semantic_content_fingerprint: impl Into<String>, ) -> Result<PreparedInputCacheIdentity, PreparedInputCacheIdentityError>
Derives the canonical prompt-cache content identity for these exact prepared parts.
Sourcepub fn parts(&self) -> &[PreparedInputPart<Tensor>]
pub fn parts(&self) -> &[PreparedInputPart<Tensor>]
Ordered owned parts.
Sourcepub fn wire_values(&self) -> Vec<&Tensor>
pub fn wire_values(&self) -> Vec<&Tensor>
Borrows payloads and metadata tensors in deterministic wire order.
Sourcepub fn from_identity_wire_values(
identity: PreparedInputIdentity,
values: Vec<Tensor>,
describe: impl Fn(&Tensor) -> Result<InputTensorIdentity, PreparedInputError>,
) -> Result<Self, PreparedInputError>
pub fn from_identity_wire_values( identity: PreparedInputIdentity, values: Vec<Tensor>, describe: impl Fn(&Tensor) -> Result<InputTensorIdentity, PreparedInputError>, ) -> Result<Self, PreparedInputError>
Reconstructs and validates input received in deterministic wire order.
Sourcepub fn into_parts(self) -> Vec<PreparedInputPart<Tensor>>
pub fn into_parts(self) -> Vec<PreparedInputPart<Tensor>>
Consumes the lifecycle container and returns its ordered parts.
Trait Implementations§
Source§impl<Tensor: Clone> Clone for PreparedModelInput<Tensor>
impl<Tensor: Clone> Clone for PreparedModelInput<Tensor>
Source§fn clone(&self) -> PreparedModelInput<Tensor>
fn clone(&self) -> PreparedModelInput<Tensor>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Tensor: Debug> Debug for PreparedModelInput<Tensor>
impl<Tensor: Debug> Debug for PreparedModelInput<Tensor>
impl<Tensor: Eq> Eq for PreparedModelInput<Tensor>
Source§impl<Tensor: PartialEq> PartialEq for PreparedModelInput<Tensor>
impl<Tensor: PartialEq> PartialEq for PreparedModelInput<Tensor>
impl<Tensor: PartialEq> StructuralPartialEq for PreparedModelInput<Tensor>
Auto Trait Implementations§
impl<Tensor> Freeze for PreparedModelInput<Tensor>
impl<Tensor> RefUnwindSafe for PreparedModelInput<Tensor>
impl<Tensor> Send for PreparedModelInput<Tensor>
impl<Tensor> Sync for PreparedModelInput<Tensor>
impl<Tensor> Unpin for PreparedModelInput<Tensor>
impl<Tensor> UnsafeUnpin for PreparedModelInput<Tensor>
impl<Tensor> UnwindSafe for PreparedModelInput<Tensor>
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