#[non_exhaustive]pub struct BatchIdentity {
pub model: String,
pub questions: String,
pub items: Vec<String>,
}Expand description
A batch’s body identity, as a runner records it at first admission.
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.model: StringThe catalog id, compared as is.
questions: StringSHA-256 of the JCS of questions, lowercase hex.
items: Vec<String>SHA-256 of the JCS of each item, lowercase hex, in request order.
Implementations§
Source§impl BatchIdentity
impl BatchIdentity
Sourcepub fn of(request: &ClassifyRequest) -> Result<Self, IdentityError>
pub fn of(request: &ClassifyRequest) -> Result<Self, IdentityError>
The identity of request.
Sourcepub fn first_difference(&self, sent: &Self) -> Option<String>
pub fn first_difference(&self, sent: &Self) -> Option<String>
The first field in which sent differs from this recorded identity,
as batch_id_reuse names it: model, questions, items (a
different item count) or items[i]. None when they are the same
body, which makes the re-send a replay.
Trait Implementations§
Source§impl Clone for BatchIdentity
impl Clone for BatchIdentity
Source§impl Debug for BatchIdentity
impl Debug for BatchIdentity
Source§impl<'de> Deserialize<'de> for BatchIdentity
impl<'de> Deserialize<'de> for BatchIdentity
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for BatchIdentity
Source§impl PartialEq for BatchIdentity
impl PartialEq for BatchIdentity
Source§impl Serialize for BatchIdentity
impl Serialize for BatchIdentity
impl StructuralPartialEq for BatchIdentity
Auto Trait Implementations§
impl Freeze for BatchIdentity
impl RefUnwindSafe for BatchIdentity
impl Send for BatchIdentity
impl Sync for BatchIdentity
impl Unpin for BatchIdentity
impl UnsafeUnpin for BatchIdentity
impl UnwindSafe for BatchIdentity
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.