-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rdfox): support for datastore params
- Loading branch information
Showing
8 changed files
with
79 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
use std::fmt::{Display, Formatter}; | ||
|
||
use crate::error::Error; | ||
use crate::ServerConnection; | ||
use crate::{error::Error, Parameters, ServerConnection}; | ||
|
||
#[derive(Debug, PartialEq, Clone)] | ||
pub struct DataStore { | ||
pub(crate) name: String, | ||
pub struct DataStore<'a> { | ||
pub name: String, | ||
pub parameters: &'a Parameters, | ||
} | ||
|
||
impl Display for DataStore { | ||
impl<'a> Display for DataStore<'a> { | ||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { | ||
write!(f, "data store [{}]", self.name) | ||
} | ||
} | ||
|
||
impl DataStore { | ||
pub fn declare(name: &str) -> Self { | ||
Self { | ||
impl<'a> DataStore<'a> { | ||
pub fn declare_with_parameters(name: &str, parameters: &'a Parameters) -> Result<Self, Error> { | ||
Ok(Self { | ||
name: name.to_string(), | ||
} | ||
parameters, | ||
}) | ||
} | ||
|
||
pub fn create(self, server_connection: &ServerConnection) -> Result<Self, Error> { | ||
server_connection.create_data_store(self) | ||
pub fn create(self, server_connection: &'a ServerConnection) -> Result<(), Error> { | ||
server_connection.create_data_store(&self).map(|_| ()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters