pub struct Point {
pub id: PointId,
pub vector: Vec<f32>,
pub payload: JsonObject,
}Expand description
A vector and its optional JSON payload, identified by a typed ID.
Fields§
§id: PointIdThe stable typed identifier for this point.
vector: Vec<f32>The vector components, whose length must match the collection dimension.
payload: JsonObjectApplication-defined metadata used by filters and optional result output.
Implementations§
Source§impl Point
impl Point
Sourcepub fn new(
id: impl Into<PointId>,
vector: impl IntoIterator<Item = f32>,
) -> Self
pub fn new( id: impl Into<PointId>, vector: impl IntoIterator<Item = f32>, ) -> Self
Creates a point with an empty payload.
Sourcepub fn with_payload(self, payload: JsonObject) -> Self
pub fn with_payload(self, payload: JsonObject) -> Self
Replaces the point payload and returns the updated point.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Point
impl<'de> Deserialize<'de> for Point
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 StructuralPartialEq for Point
Auto Trait Implementations§
impl Freeze for Point
impl RefUnwindSafe for Point
impl Send for Point
impl Sync for Point
impl Unpin for Point
impl UnsafeUnpin for Point
impl UnwindSafe for Point
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