-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build!: add features for disabling sqlite-based implementation (#74)
Release-As: 0.7.0
- Loading branch information
Showing
5 changed files
with
70 additions
and
41 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
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//! Implementation of the interface trait. | ||
|
||
use crate::error::Error; | ||
|
||
/// Trait describing the interface of a sequence repository. | ||
pub trait Interface { | ||
/// Fetch part sequence given an alias. | ||
fn fetch_sequence(&self, alias_or_seq_id: &AliasOrSeqId) -> Result<String, Error> { | ||
self.fetch_sequence_part(alias_or_seq_id, None, None) | ||
} | ||
|
||
/// Fetch part sequence given an alias. | ||
fn fetch_sequence_part( | ||
&self, | ||
alias_or_seq_id: &AliasOrSeqId, | ||
begin: Option<usize>, | ||
end: Option<usize>, | ||
) -> Result<String, Error>; | ||
} | ||
|
||
pub enum AliasOrSeqId { | ||
Alias { | ||
value: String, | ||
namespace: Option<String>, | ||
}, | ||
SeqId(String), | ||
} |
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,13 +1,24 @@ | ||
//! This is the `seqrepo` library. | ||
|
||
mod aliases; | ||
mod cached; | ||
mod error; | ||
mod fasta; | ||
mod repo; | ||
#[cfg(feature = "impl")] | ||
pub(crate) mod aliases; | ||
#[cfg(feature = "cached")] | ||
pub(crate) mod cached; | ||
pub(crate) mod error; | ||
#[cfg(feature = "impl")] | ||
pub(crate) mod fasta; | ||
#[cfg(feature = "impl")] | ||
pub(crate) mod interface; | ||
#[cfg(feature = "impl")] | ||
pub(crate) mod repo; | ||
|
||
pub use crate::aliases::*; | ||
#[cfg(feature = "cached")] | ||
pub use crate::cached::*; | ||
pub use crate::error::*; | ||
#[cfg(feature = "impl")] | ||
pub use crate::fasta::*; | ||
#[cfg(feature = "impl")] | ||
pub use crate::interface::*; | ||
#[cfg(feature = "impl")] | ||
pub use crate::repo::*; |
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