Struct bufkit_data::Archive [−][src]
pub struct Archive { /* fields omitted */ }Expand description
The archive.
Implementations
Validate files listed in the index are in the archive too, if not remove them from the index.
pub fn add(
&self,
site_id_hint: &str,
stn_num_hint: Option<StationNumber>,
init_time_hint: Option<NaiveDateTime>,
model: Model,
text_data: &str
) -> Result<StationNumber, BufkitDataErr>
pub fn add(
&self,
site_id_hint: &str,
stn_num_hint: Option<StationNumber>,
init_time_hint: Option<NaiveDateTime>,
model: Model,
text_data: &str
) -> Result<StationNumber, BufkitDataErr>Add a bufkit file to the archive.
Add a site to the list of sites.
If a site with this station number already exists, return an error from the underlying database.
Modify a site’s values.
pub fn remove(
&self,
station_num: StationNumber,
model: Model,
init_time: NaiveDateTime
) -> Result<(), BufkitDataErr>
pub fn remove(
&self,
station_num: StationNumber,
model: Model,
init_time: NaiveDateTime
) -> Result<(), BufkitDataErr>Remove a file from the archive.
Remove a site and all of its files from the archive.
Get a summary of all the stations in the archive.
Retrieve a list of sites in the archive.
pub fn sites_and_ids_for(
&self,
model: Model
) -> Result<Vec<(SiteInfo, String)>, BufkitDataErr>
pub fn sites_and_ids_for(
&self,
model: Model
) -> Result<Vec<(SiteInfo, String)>, BufkitDataErr>Retrieve the sites with their most recent station id for the given model.
Retrieve the information about a single site id
Get a list of models in the archive for this site.
pub fn retrieve(
&self,
station_num: StationNumber,
model: Model,
init_time: NaiveDateTime
) -> Result<String, BufkitDataErr>
pub fn retrieve(
&self,
station_num: StationNumber,
model: Model,
init_time: NaiveDateTime
) -> Result<String, BufkitDataErr>Retrieve a file from the archive.
pub fn retrieve_most_recent(
&self,
station_num: StationNumber,
model: Model
) -> Result<String, BufkitDataErr>
pub fn retrieve_most_recent(
&self,
station_num: StationNumber,
model: Model
) -> Result<String, BufkitDataErr>Retrieve the most recent file.
pub fn retrieve_all_valid_in(
&self,
station_num: StationNumber,
model: Model,
start: NaiveDateTime,
end: NaiveDateTime
) -> Result<impl Iterator<Item = String>, BufkitDataErr>
pub fn retrieve_all_valid_in(
&self,
station_num: StationNumber,
model: Model,
start: NaiveDateTime,
end: NaiveDateTime
) -> Result<impl Iterator<Item = String>, BufkitDataErr>Retrieve all the soundings with any data valid between the start and end times.
pub fn file_exists(
&self,
site: StationNumber,
model: Model,
init_time: NaiveDateTime
) -> Result<bool, BufkitDataErr>
pub fn file_exists(
&self,
site: StationNumber,
model: Model,
init_time: NaiveDateTime
) -> Result<bool, BufkitDataErr>Check to see if a file is present in the archive and it is retrieveable.
pub fn station_num_for_id(
&self,
id: &str,
model: Model
) -> Result<StationNumber, BufkitDataErr>
pub fn station_num_for_id(
&self,
id: &str,
model: Model
) -> Result<StationNumber, BufkitDataErr>Retrieve the most recent station number used with this ID and model.
pub fn ids(
&self,
station_num: StationNumber,
model: Model
) -> Result<Vec<String>, BufkitDataErr>
pub fn ids(
&self,
station_num: StationNumber,
model: Model
) -> Result<Vec<String>, BufkitDataErr>Retrieve a list of site ids use with the station number.
pub fn most_recent_id(
&self,
station_num: StationNumber,
model: Model
) -> Result<Option<String>, BufkitDataErr>
pub fn most_recent_id(
&self,
station_num: StationNumber,
model: Model
) -> Result<Option<String>, BufkitDataErr>Retrieve the most recently used ID with a site.
pub fn inventory(
&self,
station_num: StationNumber,
model: Model
) -> Result<Vec<NaiveDateTime>, BufkitDataErr>
pub fn inventory(
&self,
station_num: StationNumber,
model: Model
) -> Result<Vec<NaiveDateTime>, BufkitDataErr>Get an inventory of soundings for a site & model.
pub fn missing_inventory(
&self,
station_num: StationNumber,
model: Model,
time_range: Option<(NaiveDateTime, NaiveDateTime)>
) -> Result<Vec<NaiveDateTime>, BufkitDataErr>
pub fn missing_inventory(
&self,
station_num: StationNumber,
model: Model,
time_range: Option<(NaiveDateTime, NaiveDateTime)>
) -> Result<Vec<NaiveDateTime>, BufkitDataErr>Get list of missing init times.
If time_range is None, this will find the first and last entries and then look for any
gaps. If time_range is specified, then the end times are inclusive.
Get the number of files in the archive for the given station and model.
Retrieve a path to the root. Allows caller to store files in the archive.
pub fn export(
&self,
stations: &[StationNumber],
models: &[Model],
start: NaiveDateTime,
end: NaiveDateTime,
dest: &Path
) -> Result<(), BufkitDataErr>
pub fn export(
&self,
stations: &[StationNumber],
models: &[Model],
start: NaiveDateTime,
end: NaiveDateTime,
dest: &Path
) -> Result<(), BufkitDataErr>Export part of the archive.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Archiveimpl !UnwindSafe for Archive