chore: Replace crate only public interface to be completely public

This commit is contained in:
Clément Renault 2019-05-15 11:39:29 +02:00
parent 2e31bb519a
commit c5ba34d0b0
No known key found for this signature in database
GPG Key ID: 0151CDAB43460DAE
7 changed files with 9 additions and 9 deletions

View File

@ -20,7 +20,7 @@ pub struct DocumentsAddition<'a> {
}
impl<'a> DocumentsAddition<'a> {
pub(crate) fn new(inner: &'a Index, ranked_map: RankedMap) -> DocumentsAddition<'a> {
pub fn new(inner: &'a Index, ranked_map: RankedMap) -> DocumentsAddition<'a> {
DocumentsAddition {
inner,
document_ids: HashSet::new(),

View File

@ -13,7 +13,7 @@ pub struct DocumentsDeletion<'a> {
}
impl<'a> DocumentsDeletion<'a> {
pub(crate) fn new(inner: &'a Index) -> DocumentsDeletion {
pub fn new(inner: &'a Index) -> DocumentsDeletion {
DocumentsDeletion { inner, documents: Vec::new() }
}

View File

@ -8,7 +8,7 @@ use crate::document_attr_key::DocumentAttrKey;
use crate::schema::SchemaAttr;
#[derive(Clone)]
pub struct DocumentsIndex(pub(crate) Arc<sled::Tree>);
pub struct DocumentsIndex(pub Arc<sled::Tree>);
impl DocumentsIndex {
pub fn document_field(&self, id: DocumentId, attr: SchemaAttr) -> sled::Result<Option<IVec>> {

View File

@ -15,7 +15,7 @@ use crate::serde::Deserializer;
use super::{Error, RawIndex, DocumentsAddition, DocumentsDeletion};
#[derive(Clone)]
pub struct Index(pub(crate) ArcSwap<InnerIndex>);
pub struct Index(pub ArcSwap<InnerIndex>);
pub struct InnerIndex {
pub words: fst::Set,
@ -25,7 +25,7 @@ pub struct InnerIndex {
}
impl Index {
pub(crate) fn from_raw(raw: RawIndex) -> Result<Index, Error> {
pub fn from_raw(raw: RawIndex) -> Result<Index, Error> {
let words = match raw.main.words_set()? {
Some(words) => words,
None => fst::Set::default(),

View File

@ -6,7 +6,7 @@ use crate::schema::Schema;
use super::Error;
#[derive(Clone)]
pub struct MainIndex(pub(crate) Arc<sled::Tree>);
pub struct MainIndex(pub Arc<sled::Tree>);
impl MainIndex {
pub fn schema(&self) -> Result<Option<Schema>, Error> {

View File

@ -5,7 +5,7 @@ use sdset::{Set, SetBuf};
use zerocopy::{LayoutVerified, AsBytes};
#[derive(Clone)]
pub struct WordsIndex(pub(crate) Arc<sled::Tree>);
pub struct WordsIndex(pub Arc<sled::Tree>);
impl WordsIndex {
pub fn doc_indexes(&self, word: &[u8]) -> sled::Result<Option<SetBuf<DocIndex>>> {

View File

@ -134,12 +134,12 @@ impl Schema {
Ok(())
}
pub(crate) fn read_from_bin<R: Read>(reader: R) -> bincode::Result<Schema> {
pub fn read_from_bin<R: Read>(reader: R) -> bincode::Result<Schema> {
let builder: SchemaBuilder = bincode::deserialize_from(reader)?;
Ok(builder.build())
}
pub(crate) fn write_to_bin<W: Write>(&self, writer: W) -> bincode::Result<()> {
pub fn write_to_bin<W: Write>(&self, writer: W) -> bincode::Result<()> {
let identifier = self.inner.identifier.clone();
let attributes = self.attributes_ordered();
let builder = SchemaBuilder { identifier, attributes };