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
impl MemObjectIdMapping
Sourcepub fn new() -> MemObjectIdMapping
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
impl Debug for MemObjectIdMapping
Source§impl Default for MemObjectIdMapping
impl Default for MemObjectIdMapping
Source§fn default() -> MemObjectIdMapping
fn default() -> MemObjectIdMapping
Returns the “default value” for a type. Read more
Source§impl ObjectIdMapping for MemObjectIdMapping
impl ObjectIdMapping for MemObjectIdMapping
Source§fn encoding(&self) -> ObjectIdEncoding
fn encoding(&self) -> ObjectIdEncoding
Returns the encoding.
Source§fn try_get_object_id(
&self,
scalar: &PlainTermScalar,
) -> Result<Option<ObjectIdScalar>, ObjectIdMappingError>
fn try_get_object_id( &self, scalar: &PlainTermScalar, ) -> Result<Option<ObjectIdScalar>, ObjectIdMappingError>
Try to retrieve the object id of the given
scalar. Read moreSource§fn encode_array(
&self,
array: &PlainTermArray,
) -> Result<ObjectIdArray, ObjectIdMappingError>
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>
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>
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>
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>
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>
fn decode_scalar_to_typed_value( &self, scalar: &ObjectIdScalar, ) -> Result<TypedValueScalar, ObjectIdMappingError>
Decodes a single
scalar as a TypedValueScalar.Auto Trait Implementations§
impl !Freeze for MemObjectIdMapping
impl !RefUnwindSafe for MemObjectIdMapping
impl Send for MemObjectIdMapping
impl Sync for MemObjectIdMapping
impl Unpin for MemObjectIdMapping
impl UnwindSafe for MemObjectIdMapping
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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