Skip to main content

EntityBuilder

Struct EntityBuilder 

Source
pub struct EntityBuilder<'a> { /* private fields */ }
Expand description

Builder for entity values (used in CreateEntity).

Implementations§

Source§

impl<'a> EntityBuilder<'a>

Source

pub fn new() -> Self

Creates a new empty EntityBuilder.

Source

pub fn value(self, property: Id, value: Value<'a>) -> Self

Adds a property value.

Source

pub fn text( self, property: Id, value: impl Into<Cow<'a, str>>, language: Option<Id>, ) -> Self

Adds a TEXT value.

Source

pub fn int64(self, property: Id, value: i64, unit: Option<Id>) -> Self

Adds an INT64 value.

Source

pub fn float64(self, property: Id, value: f64, unit: Option<Id>) -> Self

Adds a FLOAT64 value.

Source

pub fn bool(self, property: Id, value: bool) -> Self

Adds a BOOL value.

Source

pub fn bytes(self, property: Id, value: impl Into<Cow<'a, [u8]>>) -> Self

Adds a BYTES value.

Source

pub fn point(self, property: Id, lon: f64, lat: f64, alt: Option<f64>) -> Self

Adds a POINT value (longitude, latitude, optional altitude).

Source

pub fn date(self, property: Id, value: impl Into<Cow<'a, str>>) -> Self

Adds a DATE value in RFC 3339 format.

§Arguments
  • value - RFC 3339 date string (e.g., “2024-01-15” or “2024-01-15+05:30”)
Source

pub fn time(self, property: Id, value: impl Into<Cow<'a, str>>) -> Self

Adds a TIME value in RFC 3339 format.

§Arguments
  • value - RFC 3339 time string (e.g., “14:30:45.123456Z” or “14:30:45+05:30”)
Source

pub fn datetime(self, property: Id, value: impl Into<Cow<'a, str>>) -> Self

Adds a DATETIME value in RFC 3339 format.

§Arguments
  • value - RFC 3339 datetime string (e.g., “2024-01-15T14:30:45.123456Z”)
Source

pub fn schedule(self, property: Id, value: impl Into<Cow<'a, str>>) -> Self

Adds a SCHEDULE value (RFC 5545 iCalendar format).

Source

pub fn decimal( self, property: Id, exponent: i32, mantissa: DecimalMantissa<'a>, unit: Option<Id>, ) -> Self

Adds a DECIMAL value.

Source

pub fn embedding( self, property: Id, sub_type: EmbeddingSubType, dims: usize, data: impl Into<Cow<'a, [u8]>>, ) -> Self

Adds an EMBEDDING value.

Trait Implementations§

Source§

impl<'a> Clone for EntityBuilder<'a>

Source§

fn clone(&self) -> EntityBuilder<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for EntityBuilder<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Default for EntityBuilder<'a>

Source§

fn default() -> EntityBuilder<'a>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for EntityBuilder<'a>

§

impl<'a> RefUnwindSafe for EntityBuilder<'a>

§

impl<'a> Send for EntityBuilder<'a>

§

impl<'a> Sync for EntityBuilder<'a>

§

impl<'a> Unpin for EntityBuilder<'a>

§

impl<'a> UnwindSafe for EntityBuilder<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.