MemObjectIdMapping

Struct MemObjectIdMapping 

Source
pub struct MemObjectIdMapping { /* private fields */ }
Expand description

Maintains a mapping between RDF terms and object IDs in memory.

The mapping happens on two levels: first, all strings are interned, second, the encoded term that refers to the interned strings is mapped to an encoded Object ID.

§Object IDs

The encoded Object ID is a 32-bit unsigned integer used to uniquely identify RDF terms. Currently, we simply use a counter to allocate new object IDs.

§Typed Values

In addition to mapping object ids to terms, we also maintain a mapping to the typed value to speed-up queries working on typed values.

Implementations§

Source§

impl MemObjectIdMapping

Source

pub fn new() -> MemObjectIdMapping

Creates a new empty MemObjectIdMapping.

The given encodings are used for creating the outputs of the mapping.

Trait Implementations§

Source§

impl Debug for MemObjectIdMapping

Source§

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

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

impl Default for MemObjectIdMapping

Source§

fn default() -> MemObjectIdMapping

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

impl ObjectIdMapping for MemObjectIdMapping

Source§

fn encoding(&self) -> ObjectIdEncoding

Returns the encoding.
Source§

fn try_get_object_id( &self, scalar: &PlainTermScalar, ) -> Result<Option<ObjectIdScalar>, ObjectIdMappingError>

Try to retrieve the object id of the given scalar. Read more
Source§

fn encode_array( &self, array: &PlainTermArray, ) -> Result<ObjectIdArray, ObjectIdMappingError>

Encodings the entire array as an ObjectIdArray. Automatically creates a mapping for a fresh object id if a term is not yet mapped.
Source§

fn decode_array( &self, array: &ObjectIdArray, ) -> Result<PlainTermArray, ObjectIdMappingError>

Decodes the entire array as a PlainTermArray.
Source§

fn decode_array_to_typed_value( &self, array: &ObjectIdArray, ) -> Result<TypedValueArray, ObjectIdMappingError>

Decodes the entire array as a TypedValueArray.
Source§

fn encode_scalar( &self, scalar: &PlainTermScalar, ) -> Result<ObjectIdScalar, ObjectIdMappingError>

Encodes a single scalar as an ObjectIdScalar. Automatically creates a mapping for a fresh object id if the term is not yet mapped.
Source§

fn decode_scalar( &self, scalar: &ObjectIdScalar, ) -> Result<PlainTermScalar, ObjectIdMappingError>

Decodes a single scalar as a PlainTermScalar.
Source§

fn decode_scalar_to_typed_value( &self, scalar: &ObjectIdScalar, ) -> Result<TypedValueScalar, ObjectIdMappingError>

Decodes a single scalar as a TypedValueScalar.

Auto Trait Implementations§

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,