pub struct Payload(/* private fields */);Expand description
A point’s payload (JSON data).
The payload stores arbitrary JSON data associated with a point.
Implementations§
Source§impl Payload
impl Payload
Sourcepub fn from_value(value: JsonValue) -> Self
pub fn from_value(value: JsonValue) -> Self
Create a payload from a JSON value.
Sourcepub fn value_mut(&mut self) -> &mut JsonValue
pub fn value_mut(&mut self) -> &mut JsonValue
Get a mutable reference to the underlying JSON value.
Sourcepub fn into_value(self) -> JsonValue
pub fn into_value(self) -> JsonValue
Consume and return the underlying JSON value.
Sourcepub fn insert(&mut self, key: impl Into<String>, value: JsonValue)
pub fn insert(&mut self, key: impl Into<String>, value: JsonValue)
Insert a field into the payload.
The payload must be an object for this to work.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, VectorError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, VectorError>
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>,
Deserialize this value from the given Serde deserializer. Read more
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
Mutably borrows from an owned value. Read more