pub struct Archival<F: FileSystemAPI + Clone + Debug> {
pub site: Site,
/* private fields */
}Fields§
§site: SiteImplementations§
Source§impl<F: FileSystemAPI + Clone + Debug> Archival<F>
impl<F: FileSystemAPI + Clone + Debug> Archival<F>
pub fn is_compatible(fs: &F) -> Result<bool, Box<dyn Error>>
pub fn new(fs: F) -> Result<Self, Box<dyn Error>>
pub fn new_with_upload_prefix( fs: F, upload_prefix: &str, ) -> Result<Self, Box<dyn Error>>
pub fn new_with_field_config( fs: F, field_config: FieldConfig, ) -> Result<Self, Box<dyn Error>>
pub fn build( &self, options: BuildOptions, ) -> Result<ArchivalBuildId, Box<dyn Error>>
pub fn dump_schemas(&self) -> Result<(), Box<dyn Error>>
pub fn generate_root_json_schema( &self, options: ObjectSchemaOptions, ) -> ObjectSchema
pub fn dist_file(&self, path: &Path) -> Option<Vec<u8>>
pub fn dist_files(&self) -> Vec<DistFile>
pub fn object_exists( &self, obj_type: &str, filename: &str, ) -> Result<bool, Box<dyn Error>>
pub fn object_path(&self, obj_type: &str, filename: &str) -> PathBuf
pub fn build_id(&self) -> Result<u64, Box<dyn Error>>
pub fn object_file( &self, obj_type: &str, filename: &str, ) -> Result<String, Box<dyn Error>>
pub fn sha_for_file(&self, file: &Path) -> Result<String, Box<dyn Error>>
pub fn write_file( &self, obj_type: &str, filename: &str, contents: String, ) -> Result<(), Box<dyn Error>>
pub fn send_event( &self, event: ArchivalEvent, build_options: Option<BuildOptions>, ) -> Result<ArchivalEventResponse, Box<dyn Error>>
pub fn manifest_content(&self) -> Result<String, Box<dyn Error>>
pub fn get_objects( &self, ) -> Result<BTreeMap<String, ObjectEntry>, Box<dyn Error>>
pub fn get_object( &self, name: &str, filename: Option<&str>, ) -> Result<Object, Box<dyn Error>>
pub fn get_objects_sorted( &self, sort: impl Fn(&Object, &Object) -> Ordering, ) -> Result<BTreeMap<String, ObjectEntry>, Box<dyn Error>>
pub fn modify_manifest( &mut self, modify: impl FnOnce(&mut Manifest), ) -> Result<(), Box<dyn Error>>
Sourcepub fn delete_objects(
&self,
object_names: impl IntoIterator<Item = impl AsRef<str>>,
keep_objects: Option<Vec<ValuePath>>,
) -> Result<(), Box<dyn Error>>
pub fn delete_objects( &self, object_names: impl IntoIterator<Item = impl AsRef<str>>, keep_objects: Option<Vec<ValuePath>>, ) -> Result<(), Box<dyn Error>>
Deletes all the object files for the given object types, except the ones (optionally) specified in the list of keep_objects. This only deletes the files, and does not generate events or rebuild the archival site.
pub fn take_fs(self) -> F
pub fn clone_fs(&self) -> Result<F, Box<dyn Error>>
Trait Implementations§
Auto Trait Implementations§
impl<F> !Freeze for Archival<F>
impl<F> RefUnwindSafe for Archival<F>
impl<F> Send for Archival<F>
impl<F> Sync for Archival<F>
impl<F> Unpin for Archival<F>where
F: Unpin,
impl<F> UnwindSafe for Archival<F>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more