[][src]Struct bufkit_data::Archive

pub struct Archive { /* fields omitted */ }

The archive.

Methods

impl Archive[src]

pub fn create<T>(root: T) -> Result<Self, BufkitDataErr> where
    T: AsRef<Path>, 
[src]

Initialize a new archive.

pub fn connect<T>(root: T) -> Result<Self, BufkitDataErr> where
    T: AsRef<Path>, 
[src]

Open an existing archive.

pub fn clean(
    &self
) -> Result<(JoinHandle<Result<(), BufkitDataErr>>, Receiver<String>), BufkitDataErr>
[src]

Validate files listed in the index are in the archive too, if not remove them from the index.

pub fn root(&self) -> &Path[src]

Retrieve a path to the root. Allows caller to store files in the archive.

pub fn sites(&self) -> Result<Vec<Site>, BufkitDataErr>[src]

Retrieve a list of sites in the archive.

pub fn site_info(&self, site_id: &str) -> Result<Site, BufkitDataErr>[src]

Retrieve the information about a single site.

pub fn set_site_info(&self, site: &Site) -> Result<(), BufkitDataErr>[src]

Modify a sites values.

pub fn add_site(&self, site: &Site) -> Result<(), BufkitDataErr>[src]

Add a site to the list of sites.

pub fn site_exists(&self, site_id: &str) -> Result<bool, BufkitDataErr>[src]

Check if a site already exists

pub fn init_times(
    &self,
    site_id: &str,
    model: Model
) -> Result<Vec<NaiveDateTime>, BufkitDataErr>
[src]

Get a list of all the available model initialization times for a given site and model.

pub fn count_init_times(
    &self,
    site_id: &str,
    model: Model
) -> Result<i64, BufkitDataErr>
[src]

Get the number of values files in the archive for the model and intitialization time.

pub fn inventory(
    &self,
    site_id: &str,
    model: Model
) -> Result<Inventory, BufkitDataErr>
[src]

Get an inventory of soundings for a site & model.

pub fn models(&self, site_id: &str) -> Result<Vec<Model>, BufkitDataErr>[src]

Get a list of models in the archive for this site.

pub fn most_recent_valid_time(
    &self,
    site_id: &str,
    model: Model
) -> Result<NaiveDateTime, BufkitDataErr>
[src]

Retrieve the model initialization time of the most recent model in the archive.

pub fn file_exists(
    &self,
    site_id: &str,
    model: Model,
    init_time: &NaiveDateTime
) -> Result<bool, BufkitDataErr>
[src]

Check to see if a file is present in the archive and it is retrieveable.

pub fn count(&self) -> Result<i64, BufkitDataErr>[src]

Get the number of files stored in the archive.

pub fn add(
    &self,
    site_id: &str,
    model: Model,
    init_time: &NaiveDateTime,
    text_data: &str
) -> Result<(), BufkitDataErr>
[src]

Add a bufkit file to the archive.

pub fn retrieve(
    &self,
    site_id: &str,
    model: Model,
    init_time: &NaiveDateTime
) -> Result<String, BufkitDataErr>
[src]

Retrieve a file from the archive.

pub fn most_recent_file(
    &self,
    site_id: &str,
    model: Model
) -> Result<String, BufkitDataErr>
[src]

Retrieve the most recent file

pub fn file_name(
    &self,
    site_id: &str,
    model: Model,
    init_time: &NaiveDateTime
) -> String
[src]

Get the file name this would have if uncompressed.

pub fn remove(
    &self,
    site_id: &str,
    model: Model,
    init_time: &NaiveDateTime
) -> Result<(), BufkitDataErr>
[src]

Remove a file from the archive.

Trait Implementations

impl Debug for Archive[src]

Auto Trait Implementations

impl Send for Archive

impl !Sync for Archive

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.