|
|
@ -74,7 +74,7 @@ impl Storage { |
|
|
|
for quad in this.quads() { |
|
|
|
for quad in this.quads() { |
|
|
|
let quad = quad?; |
|
|
|
let quad = quad?; |
|
|
|
if !quad.graph_name.is_default_graph() { |
|
|
|
if !quad.graph_name.is_default_graph() { |
|
|
|
this.insert_named_graph(quad.graph_name)?; |
|
|
|
this.insert_named_graph(&quad.graph_name)?; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
version = 1; |
|
|
|
version = 1; |
|
|
@ -168,10 +168,10 @@ impl Storage { |
|
|
|
|
|
|
|
|
|
|
|
pub fn quads_for_pattern( |
|
|
|
pub fn quads_for_pattern( |
|
|
|
&self, |
|
|
|
&self, |
|
|
|
subject: Option<EncodedTerm>, |
|
|
|
subject: Option<&EncodedTerm>, |
|
|
|
predicate: Option<EncodedTerm>, |
|
|
|
predicate: Option<&EncodedTerm>, |
|
|
|
object: Option<EncodedTerm>, |
|
|
|
object: Option<&EncodedTerm>, |
|
|
|
graph_name: Option<EncodedTerm>, |
|
|
|
graph_name: Option<&EncodedTerm>, |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
match subject { |
|
|
|
match subject { |
|
|
|
Some(subject) => match predicate { |
|
|
|
Some(subject) => match predicate { |
|
|
@ -236,7 +236,7 @@ impl Storage { |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fn quads_for_subject(&self, subject: EncodedTerm) -> ChainedDecodingQuadIterator { |
|
|
|
fn quads_for_subject(&self, subject: &EncodedTerm) -> ChainedDecodingQuadIterator { |
|
|
|
ChainedDecodingQuadIterator::pair( |
|
|
|
ChainedDecodingQuadIterator::pair( |
|
|
|
self.dspo_quads(encode_term(subject)), |
|
|
|
self.dspo_quads(encode_term(subject)), |
|
|
|
self.spog_quads(encode_term(subject)), |
|
|
|
self.spog_quads(encode_term(subject)), |
|
|
@ -245,8 +245,8 @@ impl Storage { |
|
|
|
|
|
|
|
|
|
|
|
fn quads_for_subject_predicate( |
|
|
|
fn quads_for_subject_predicate( |
|
|
|
&self, |
|
|
|
&self, |
|
|
|
subject: EncodedTerm, |
|
|
|
subject: &EncodedTerm, |
|
|
|
predicate: EncodedTerm, |
|
|
|
predicate: &EncodedTerm, |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
ChainedDecodingQuadIterator::pair( |
|
|
|
ChainedDecodingQuadIterator::pair( |
|
|
|
self.dspo_quads(encode_term_pair(subject, predicate)), |
|
|
|
self.dspo_quads(encode_term_pair(subject, predicate)), |
|
|
@ -256,9 +256,9 @@ impl Storage { |
|
|
|
|
|
|
|
|
|
|
|
fn quads_for_subject_predicate_object( |
|
|
|
fn quads_for_subject_predicate_object( |
|
|
|
&self, |
|
|
|
&self, |
|
|
|
subject: EncodedTerm, |
|
|
|
subject: &EncodedTerm, |
|
|
|
predicate: EncodedTerm, |
|
|
|
predicate: &EncodedTerm, |
|
|
|
object: EncodedTerm, |
|
|
|
object: &EncodedTerm, |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
ChainedDecodingQuadIterator::pair( |
|
|
|
ChainedDecodingQuadIterator::pair( |
|
|
|
self.dspo_quads(encode_term_triple(subject, predicate, object)), |
|
|
|
self.dspo_quads(encode_term_triple(subject, predicate, object)), |
|
|
@ -268,8 +268,8 @@ impl Storage { |
|
|
|
|
|
|
|
|
|
|
|
fn quads_for_subject_object( |
|
|
|
fn quads_for_subject_object( |
|
|
|
&self, |
|
|
|
&self, |
|
|
|
subject: EncodedTerm, |
|
|
|
subject: &EncodedTerm, |
|
|
|
object: EncodedTerm, |
|
|
|
object: &EncodedTerm, |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
ChainedDecodingQuadIterator::pair( |
|
|
|
ChainedDecodingQuadIterator::pair( |
|
|
|
self.dosp_quads(encode_term_pair(object, subject)), |
|
|
|
self.dosp_quads(encode_term_pair(object, subject)), |
|
|
@ -277,7 +277,7 @@ impl Storage { |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fn quads_for_predicate(&self, predicate: EncodedTerm) -> ChainedDecodingQuadIterator { |
|
|
|
fn quads_for_predicate(&self, predicate: &EncodedTerm) -> ChainedDecodingQuadIterator { |
|
|
|
ChainedDecodingQuadIterator::pair( |
|
|
|
ChainedDecodingQuadIterator::pair( |
|
|
|
self.dpos_quads(encode_term(predicate)), |
|
|
|
self.dpos_quads(encode_term(predicate)), |
|
|
|
self.posg_quads(encode_term(predicate)), |
|
|
|
self.posg_quads(encode_term(predicate)), |
|
|
@ -286,8 +286,8 @@ impl Storage { |
|
|
|
|
|
|
|
|
|
|
|
fn quads_for_predicate_object( |
|
|
|
fn quads_for_predicate_object( |
|
|
|
&self, |
|
|
|
&self, |
|
|
|
predicate: EncodedTerm, |
|
|
|
predicate: &EncodedTerm, |
|
|
|
object: EncodedTerm, |
|
|
|
object: &EncodedTerm, |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
ChainedDecodingQuadIterator::pair( |
|
|
|
ChainedDecodingQuadIterator::pair( |
|
|
|
self.dpos_quads(encode_term_pair(predicate, object)), |
|
|
|
self.dpos_quads(encode_term_pair(predicate, object)), |
|
|
@ -295,14 +295,14 @@ impl Storage { |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fn quads_for_object(&self, object: EncodedTerm) -> ChainedDecodingQuadIterator { |
|
|
|
fn quads_for_object(&self, object: &EncodedTerm) -> ChainedDecodingQuadIterator { |
|
|
|
ChainedDecodingQuadIterator::pair( |
|
|
|
ChainedDecodingQuadIterator::pair( |
|
|
|
self.dosp_quads(encode_term(object)), |
|
|
|
self.dosp_quads(encode_term(object)), |
|
|
|
self.ospg_quads(encode_term(object)), |
|
|
|
self.ospg_quads(encode_term(object)), |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fn quads_for_graph(&self, graph_name: EncodedTerm) -> ChainedDecodingQuadIterator { |
|
|
|
fn quads_for_graph(&self, graph_name: &EncodedTerm) -> ChainedDecodingQuadIterator { |
|
|
|
ChainedDecodingQuadIterator::new(if graph_name.is_default_graph() { |
|
|
|
ChainedDecodingQuadIterator::new(if graph_name.is_default_graph() { |
|
|
|
self.dspo_quads(Vec::default()) |
|
|
|
self.dspo_quads(Vec::default()) |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -312,8 +312,8 @@ impl Storage { |
|
|
|
|
|
|
|
|
|
|
|
fn quads_for_subject_graph( |
|
|
|
fn quads_for_subject_graph( |
|
|
|
&self, |
|
|
|
&self, |
|
|
|
subject: EncodedTerm, |
|
|
|
subject: &EncodedTerm, |
|
|
|
graph_name: EncodedTerm, |
|
|
|
graph_name: &EncodedTerm, |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
ChainedDecodingQuadIterator::new(if graph_name.is_default_graph() { |
|
|
|
ChainedDecodingQuadIterator::new(if graph_name.is_default_graph() { |
|
|
|
self.dspo_quads(encode_term(subject)) |
|
|
|
self.dspo_quads(encode_term(subject)) |
|
|
@ -324,9 +324,9 @@ impl Storage { |
|
|
|
|
|
|
|
|
|
|
|
fn quads_for_subject_predicate_graph( |
|
|
|
fn quads_for_subject_predicate_graph( |
|
|
|
&self, |
|
|
|
&self, |
|
|
|
subject: EncodedTerm, |
|
|
|
subject: &EncodedTerm, |
|
|
|
predicate: EncodedTerm, |
|
|
|
predicate: &EncodedTerm, |
|
|
|
graph_name: EncodedTerm, |
|
|
|
graph_name: &EncodedTerm, |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
ChainedDecodingQuadIterator::new(if graph_name.is_default_graph() { |
|
|
|
ChainedDecodingQuadIterator::new(if graph_name.is_default_graph() { |
|
|
|
self.dspo_quads(encode_term_pair(subject, predicate)) |
|
|
|
self.dspo_quads(encode_term_pair(subject, predicate)) |
|
|
@ -337,10 +337,10 @@ impl Storage { |
|
|
|
|
|
|
|
|
|
|
|
fn quads_for_subject_predicate_object_graph( |
|
|
|
fn quads_for_subject_predicate_object_graph( |
|
|
|
&self, |
|
|
|
&self, |
|
|
|
subject: EncodedTerm, |
|
|
|
subject: &EncodedTerm, |
|
|
|
predicate: EncodedTerm, |
|
|
|
predicate: &EncodedTerm, |
|
|
|
object: EncodedTerm, |
|
|
|
object: &EncodedTerm, |
|
|
|
graph_name: EncodedTerm, |
|
|
|
graph_name: &EncodedTerm, |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
ChainedDecodingQuadIterator::new(if graph_name.is_default_graph() { |
|
|
|
ChainedDecodingQuadIterator::new(if graph_name.is_default_graph() { |
|
|
|
self.dspo_quads(encode_term_triple(subject, predicate, object)) |
|
|
|
self.dspo_quads(encode_term_triple(subject, predicate, object)) |
|
|
@ -351,9 +351,9 @@ impl Storage { |
|
|
|
|
|
|
|
|
|
|
|
fn quads_for_subject_object_graph( |
|
|
|
fn quads_for_subject_object_graph( |
|
|
|
&self, |
|
|
|
&self, |
|
|
|
subject: EncodedTerm, |
|
|
|
subject: &EncodedTerm, |
|
|
|
object: EncodedTerm, |
|
|
|
object: &EncodedTerm, |
|
|
|
graph_name: EncodedTerm, |
|
|
|
graph_name: &EncodedTerm, |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
ChainedDecodingQuadIterator::new(if graph_name.is_default_graph() { |
|
|
|
ChainedDecodingQuadIterator::new(if graph_name.is_default_graph() { |
|
|
|
self.dosp_quads(encode_term_pair(object, subject)) |
|
|
|
self.dosp_quads(encode_term_pair(object, subject)) |
|
|
@ -364,8 +364,8 @@ impl Storage { |
|
|
|
|
|
|
|
|
|
|
|
fn quads_for_predicate_graph( |
|
|
|
fn quads_for_predicate_graph( |
|
|
|
&self, |
|
|
|
&self, |
|
|
|
predicate: EncodedTerm, |
|
|
|
predicate: &EncodedTerm, |
|
|
|
graph_name: EncodedTerm, |
|
|
|
graph_name: &EncodedTerm, |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
ChainedDecodingQuadIterator::new(if graph_name.is_default_graph() { |
|
|
|
ChainedDecodingQuadIterator::new(if graph_name.is_default_graph() { |
|
|
|
self.dpos_quads(encode_term(predicate)) |
|
|
|
self.dpos_quads(encode_term(predicate)) |
|
|
@ -376,9 +376,9 @@ impl Storage { |
|
|
|
|
|
|
|
|
|
|
|
fn quads_for_predicate_object_graph( |
|
|
|
fn quads_for_predicate_object_graph( |
|
|
|
&self, |
|
|
|
&self, |
|
|
|
predicate: EncodedTerm, |
|
|
|
predicate: &EncodedTerm, |
|
|
|
object: EncodedTerm, |
|
|
|
object: &EncodedTerm, |
|
|
|
graph_name: EncodedTerm, |
|
|
|
graph_name: &EncodedTerm, |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
ChainedDecodingQuadIterator::new(if graph_name.is_default_graph() { |
|
|
|
ChainedDecodingQuadIterator::new(if graph_name.is_default_graph() { |
|
|
|
self.dpos_quads(encode_term_pair(predicate, object)) |
|
|
|
self.dpos_quads(encode_term_pair(predicate, object)) |
|
|
@ -389,8 +389,8 @@ impl Storage { |
|
|
|
|
|
|
|
|
|
|
|
fn quads_for_object_graph( |
|
|
|
fn quads_for_object_graph( |
|
|
|
&self, |
|
|
|
&self, |
|
|
|
object: EncodedTerm, |
|
|
|
object: &EncodedTerm, |
|
|
|
graph_name: EncodedTerm, |
|
|
|
graph_name: &EncodedTerm, |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
) -> ChainedDecodingQuadIterator { |
|
|
|
ChainedDecodingQuadIterator::new(if graph_name.is_default_graph() { |
|
|
|
ChainedDecodingQuadIterator::new(if graph_name.is_default_graph() { |
|
|
|
self.dosp_quads(encode_term(object)) |
|
|
|
self.dosp_quads(encode_term(object)) |
|
|
@ -405,7 +405,7 @@ impl Storage { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn contains_named_graph(&self, graph_name: EncodedTerm) -> Result<bool, std::io::Error> { |
|
|
|
pub fn contains_named_graph(&self, graph_name: &EncodedTerm) -> Result<bool, std::io::Error> { |
|
|
|
Ok(self.graphs.contains_key(&encode_term(graph_name))?) |
|
|
|
Ok(self.graphs.contains_key(&encode_term(graph_name))?) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -503,7 +503,7 @@ impl Storage { |
|
|
|
self.gosp.insert(buffer.as_slice(), &[])?; |
|
|
|
self.gosp.insert(buffer.as_slice(), &[])?; |
|
|
|
buffer.clear(); |
|
|
|
buffer.clear(); |
|
|
|
|
|
|
|
|
|
|
|
write_term(&mut buffer, quad.graph_name); |
|
|
|
write_term(&mut buffer, &quad.graph_name); |
|
|
|
self.graphs.insert(&buffer, &[])?; |
|
|
|
self.graphs.insert(&buffer, &[])?; |
|
|
|
buffer.clear(); |
|
|
|
buffer.clear(); |
|
|
|
} |
|
|
|
} |
|
|
@ -564,11 +564,11 @@ impl Storage { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn insert_named_graph(&self, graph_name: EncodedTerm) -> Result<bool, std::io::Error> { |
|
|
|
pub fn insert_named_graph(&self, graph_name: &EncodedTerm) -> Result<bool, std::io::Error> { |
|
|
|
Ok(self.graphs.insert(&encode_term(graph_name), &[])?.is_none()) |
|
|
|
Ok(self.graphs.insert(&encode_term(graph_name), &[])?.is_none()) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn clear_graph(&self, graph_name: EncodedTerm) -> Result<(), std::io::Error> { |
|
|
|
pub fn clear_graph(&self, graph_name: &EncodedTerm) -> Result<(), std::io::Error> { |
|
|
|
if graph_name.is_default_graph() { |
|
|
|
if graph_name.is_default_graph() { |
|
|
|
self.dspo.clear()?; |
|
|
|
self.dspo.clear()?; |
|
|
|
self.dpos.clear()?; |
|
|
|
self.dpos.clear()?; |
|
|
@ -581,7 +581,7 @@ impl Storage { |
|
|
|
Ok(()) |
|
|
|
Ok(()) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn remove_named_graph(&self, graph_name: EncodedTerm) -> Result<bool, std::io::Error> { |
|
|
|
pub fn remove_named_graph(&self, graph_name: &EncodedTerm) -> Result<bool, std::io::Error> { |
|
|
|
for quad in self.quads_for_graph(graph_name) { |
|
|
|
for quad in self.quads_for_graph(graph_name) { |
|
|
|
self.remove(&quad?)?; |
|
|
|
self.remove(&quad?)?; |
|
|
|
} |
|
|
|
} |
|
|
@ -603,7 +603,7 @@ impl Storage { |
|
|
|
Ok(()) |
|
|
|
Ok(()) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn get_str(&self, key: StrHash) -> Result<Option<String>, std::io::Error> { |
|
|
|
pub fn get_str(&self, key: &StrHash) -> Result<Option<String>, std::io::Error> { |
|
|
|
self.id2str |
|
|
|
self.id2str |
|
|
|
.get(key.to_be_bytes())? |
|
|
|
.get(key.to_be_bytes())? |
|
|
|
.map(|v| String::from_utf8(v.to_vec())) |
|
|
|
.map(|v| String::from_utf8(v.to_vec())) |
|
|
@ -611,11 +611,11 @@ impl Storage { |
|
|
|
.map_err(invalid_data_error) |
|
|
|
.map_err(invalid_data_error) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn contains_str(&self, key: StrHash) -> Result<bool, std::io::Error> { |
|
|
|
pub fn contains_str(&self, key: &StrHash) -> Result<bool, std::io::Error> { |
|
|
|
Ok(self.id2str.contains_key(key.to_be_bytes())?) |
|
|
|
Ok(self.id2str.contains_key(key.to_be_bytes())?) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn insert_str(&self, key: StrHash, value: &str) -> Result<bool, std::io::Error> { |
|
|
|
pub fn insert_str(&self, key: &StrHash, value: &str) -> Result<bool, std::io::Error> { |
|
|
|
Ok(self.id2str.insert(key.to_be_bytes(), value)?.is_none()) |
|
|
|
Ok(self.id2str.insert(key.to_be_bytes(), value)?.is_none()) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -748,7 +748,7 @@ impl<'a> StorageTransaction<'a> { |
|
|
|
self.gosp.insert(buffer.as_slice(), &[])?; |
|
|
|
self.gosp.insert(buffer.as_slice(), &[])?; |
|
|
|
buffer.clear(); |
|
|
|
buffer.clear(); |
|
|
|
|
|
|
|
|
|
|
|
write_term(&mut buffer, quad.graph_name); |
|
|
|
write_term(&mut buffer, &quad.graph_name); |
|
|
|
self.graphs.insert(buffer.as_slice(), &[])?; |
|
|
|
self.graphs.insert(buffer.as_slice(), &[])?; |
|
|
|
buffer.clear(); |
|
|
|
buffer.clear(); |
|
|
|
} |
|
|
|
} |
|
|
@ -811,12 +811,12 @@ impl<'a> StorageTransaction<'a> { |
|
|
|
|
|
|
|
|
|
|
|
pub fn insert_named_graph( |
|
|
|
pub fn insert_named_graph( |
|
|
|
&self, |
|
|
|
&self, |
|
|
|
graph_name: EncodedTerm, |
|
|
|
graph_name: &EncodedTerm, |
|
|
|
) -> Result<bool, UnabortableTransactionError> { |
|
|
|
) -> Result<bool, UnabortableTransactionError> { |
|
|
|
Ok(self.graphs.insert(encode_term(graph_name), &[])?.is_none()) |
|
|
|
Ok(self.graphs.insert(encode_term(graph_name), &[])?.is_none()) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn get_str(&self, key: StrHash) -> Result<Option<String>, UnabortableTransactionError> { |
|
|
|
pub fn get_str(&self, key: &StrHash) -> Result<Option<String>, UnabortableTransactionError> { |
|
|
|
self.id2str |
|
|
|
self.id2str |
|
|
|
.get(key.to_be_bytes())? |
|
|
|
.get(key.to_be_bytes())? |
|
|
|
.map(|v| String::from_utf8(v.to_vec())) |
|
|
|
.map(|v| String::from_utf8(v.to_vec())) |
|
|
@ -824,13 +824,13 @@ impl<'a> StorageTransaction<'a> { |
|
|
|
.map_err(|e| UnabortableTransactionError::Storage(invalid_data_error(e))) |
|
|
|
.map_err(|e| UnabortableTransactionError::Storage(invalid_data_error(e))) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn contains_str(&self, key: StrHash) -> Result<bool, UnabortableTransactionError> { |
|
|
|
pub fn contains_str(&self, key: &StrHash) -> Result<bool, UnabortableTransactionError> { |
|
|
|
Ok(self.id2str.get(key.to_be_bytes())?.is_some()) |
|
|
|
Ok(self.id2str.get(key.to_be_bytes())?.is_some()) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pub fn insert_str( |
|
|
|
pub fn insert_str( |
|
|
|
&self, |
|
|
|
&self, |
|
|
|
key: StrHash, |
|
|
|
key: &StrHash, |
|
|
|
value: &str, |
|
|
|
value: &str, |
|
|
|
) -> Result<bool, UnabortableTransactionError> { |
|
|
|
) -> Result<bool, UnabortableTransactionError> { |
|
|
|
Ok(self.id2str.insert(&key.to_be_bytes(), value)?.is_none()) |
|
|
|
Ok(self.id2str.insert(&key.to_be_bytes(), value)?.is_none()) |
|
|
@ -992,17 +992,17 @@ impl<T> From<ConflictableTransactionError<T>> for Sled2ConflictableTransactionEr |
|
|
|
impl StrLookup for Storage { |
|
|
|
impl StrLookup for Storage { |
|
|
|
type Error = std::io::Error; |
|
|
|
type Error = std::io::Error; |
|
|
|
|
|
|
|
|
|
|
|
fn get_str(&self, key: StrHash) -> Result<Option<String>, std::io::Error> { |
|
|
|
fn get_str(&self, key: &StrHash) -> Result<Option<String>, std::io::Error> { |
|
|
|
self.get_str(key) |
|
|
|
self.get_str(key) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fn contains_str(&self, key: StrHash) -> Result<bool, std::io::Error> { |
|
|
|
fn contains_str(&self, key: &StrHash) -> Result<bool, std::io::Error> { |
|
|
|
self.contains_str(key) |
|
|
|
self.contains_str(key) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
impl StrContainer for Storage { |
|
|
|
impl StrContainer for Storage { |
|
|
|
fn insert_str(&self, key: StrHash, value: &str) -> Result<bool, std::io::Error> { |
|
|
|
fn insert_str(&self, key: &StrHash, value: &str) -> Result<bool, std::io::Error> { |
|
|
|
self.insert_str(key, value) |
|
|
|
self.insert_str(key, value) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1010,17 +1010,17 @@ impl StrContainer for Storage { |
|
|
|
impl<'a> StrLookup for StorageTransaction<'a> { |
|
|
|
impl<'a> StrLookup for StorageTransaction<'a> { |
|
|
|
type Error = UnabortableTransactionError; |
|
|
|
type Error = UnabortableTransactionError; |
|
|
|
|
|
|
|
|
|
|
|
fn get_str(&self, key: StrHash) -> Result<Option<String>, UnabortableTransactionError> { |
|
|
|
fn get_str(&self, key: &StrHash) -> Result<Option<String>, UnabortableTransactionError> { |
|
|
|
self.get_str(key) |
|
|
|
self.get_str(key) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fn contains_str(&self, key: StrHash) -> Result<bool, UnabortableTransactionError> { |
|
|
|
fn contains_str(&self, key: &StrHash) -> Result<bool, UnabortableTransactionError> { |
|
|
|
self.contains_str(key) |
|
|
|
self.contains_str(key) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
impl<'a> StrContainer for StorageTransaction<'a> { |
|
|
|
impl<'a> StrContainer for StorageTransaction<'a> { |
|
|
|
fn insert_str(&self, key: StrHash, value: &str) -> Result<bool, UnabortableTransactionError> { |
|
|
|
fn insert_str(&self, key: &StrHash, value: &str) -> Result<bool, UnabortableTransactionError> { |
|
|
|
self.insert_str(key, value) |
|
|
|
self.insert_str(key, value) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|