pub struct Payload(/* private fields */);
Expand description
Point payload
A JSON-like object that can be attached to points. With payloads you can store any kind of information along with your points. Qdrant provides comprehensive ways to filter on payload values during vector search.
Payload documentation: https://qdrant.tech/documentation/concepts/payload/
§Serde
Requires serde
feature
Serde JSON types can be converted to and from Payload
. Note that a valid
payload must be a JSON object, and not another JSON type.
Convert a JSON Value
to and from Payload
:
use serde_json::{Value, json};
let value = json!({
"city": "Berlin",
});
let payload = Payload::try_from(value).expect("not a JSON object");
let value = Value::from(payload);
If the above value is not a JSON object, a QdrantError::JsonToPayload
error is returned.
Convert a JSON object (Map<String, Value>
) to and from from Payload
:
use serde_json::{Map, Value};
let mut object = Map::new();
object.insert("city".to_string(), "Berlin".into());
let payload = Payload::from(object);
let object = Map::from(payload);
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Payload
impl<'de> Deserialize<'de> for Payload
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>,
source§impl TryFrom<Value> for Payload
impl TryFrom<Value> for Payload
source§fn try_from(value: Value) -> Result<Self, Self::Error>
fn try_from(value: Value) -> Result<Self, Self::Error>
Convert JSON object into payload
The JSON value must be a valid object. A JSON object of type
Map<String, Value>
can be converted without errors using
Payload::from
.
§Errors
Returns an QdrantError::JsonToPayload
error if the
value is not an object.
source§type Error = QdrantError
type Error = QdrantError
impl StructuralPartialEq for Payload
Auto Trait Implementations§
impl Freeze for Payload
impl RefUnwindSafe for Payload
impl Send for Payload
impl Sync for Payload
impl Unpin for Payload
impl UnwindSafe for Payload
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request