pub struct Archival<F: FileSystemAPI + Clone + Debug> {
pub site: Site,
/* private fields */
}Fields§
§site: SiteImplementations§
Source§impl<F: FileSystemAPI + Clone + Debug> Archival<F>
This API is primarily intended for direct modifications to site files,
rather than changing objects, which should always be done via archival events.
impl<F: FileSystemAPI + Clone + Debug> Archival<F>
This API is primarily intended for direct modifications to site files, rather than changing objects, which should always be done via archival events.
pub fn fs_list_files( &self, dir: impl AsRef<Path>, recursive: bool, ignore: Option<Vec<&str>>, ) -> Result<Vec<PathBuf>>
pub fn fs_read_file(&self, path: impl AsRef<Path>) -> Result<String>
pub fn fs_write_file( &self, path: impl AsRef<Path>, contents: String, ) -> Result<()>
pub fn fs_delete_file(&self, path: impl AsRef<Path>) -> Result<()>
pub fn fs_rename_file( &self, from: impl AsRef<Path>, to: impl AsRef<Path>, ) -> Result<()>
Source§impl<F: FileSystemAPI + Clone + Debug> Archival<F>
impl<F: FileSystemAPI + Clone + Debug> Archival<F>
pub fn is_compatible(fs: &F) -> Result<bool>
pub fn new(fs: F) -> Result<Self>
pub fn new_with_upload_prefix(fs: F, upload_prefix: &str) -> Result<Self>
pub fn build(&self, options: BuildOptions) -> Result<ArchivalBuildId>
pub fn dump_schemas(&self) -> Result<()>
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>
pub fn object_path(&self, obj_type: &str, filename: &str) -> PathBuf
pub fn build_id(&self) -> u64
Sourcepub fn objects_generation(&self) -> u64
pub fn objects_generation(&self) -> u64
See [Site::objects_generation].
pub fn fs_id(&self) -> Result<u64>
pub fn list_build_files( &self, ) -> Result<impl Iterator<Item = PathBuf> + use<'_, F>>
pub fn object_file(&self, obj_type: &str, filename: &str) -> Result<String>
pub fn sha_for_file(&self, file: &Path) -> Result<String>
pub fn write_file( &self, obj_type: &str, filename: &str, contents: String, ) -> Result<()>
pub fn send_event( &self, event: ArchivalEvent, build_options: Option<BuildOptions>, ) -> Result<ArchivalEventResponse>
pub fn manifest_content(&self) -> Result<String>
pub fn get_object_definition( &self, name: &str, ) -> Result<&ObjectDefinition, ArchivalError>
pub fn get_objects(&self) -> Result<ObjectMap>
pub fn get_object(&self, name: &str, filename: Option<&str>) -> Result<Object>
pub fn get_objects_sorted( &self, sort: impl Fn(&Object, &Object) -> Ordering, ) -> Result<ObjectMap>
pub fn get_rendered_objects(&self) -> Result<RenderedObjectMap>
pub fn get_rendered_object( &self, name: &str, filename: Option<&str>, ) -> Result<RenderedObject>
pub fn get_rendered_objects_sorted( &self, sort: impl Fn(&Object, &Object) -> Ordering, ) -> Result<RenderedObjectMap>
pub fn modify_manifest( &mut self, modify: impl FnOnce(&mut Manifest), ) -> Result<()>
Sourcepub fn delete_objects(
&self,
object_names: impl IntoIterator<Item = impl AsRef<str>>,
keep_objects: Option<Vec<ValuePath>>,
) -> Result<()>
pub fn delete_objects( &self, object_names: impl IntoIterator<Item = impl AsRef<str>>, keep_objects: Option<Vec<ValuePath>>, ) -> Result<()>
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>
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> UnsafeUnpin for Archival<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for Archival<F>
Blanket Implementations§
impl<T> Any for Twhere
T: Any,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more