pub struct Repository {
pub id: u64,
pub name: String,
pub size_bytes: u64,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub machine: Option<RepositoryMachine>,
pub group: Option<Group>,
/* private fields */
}Expand description
A saved machine: a numbered, principal owned chain of disk revisions on the
one Termite base image. /repository inside it is a git folder whose history
is changes(). Start it with os::MachineRoom::start.
Fields§
§id: u64§name: String§size_bytes: u64§created_at: DateTime<Utc>§updated_at: DateTime<Utc>§machine: Option<RepositoryMachine>Its machine while one is booting, running, or saving.
group: Option<Group>The group that owns it, when it isn’t personal.
Implementations§
Source§impl Repository
impl Repository
pub fn from_json( json: &Value, authorization: &CredentialsOrApiKey, group: Option<&Group>, ) -> Repository
pub fn routes(&self) -> Result<Vec<Route>>
Sourcepub async fn changes(&self, query: PageQuery) -> Result<Vec<Change>>
pub async fn changes(&self, query: PageQuery) -> Result<Vec<Change>>
Revisions newest first. cursor: 0 is the latest revision.
Sourcepub async fn open(&self, path: Option<&str>) -> Result<FileOrFiles>
pub async fn open(&self, path: Option<&str>) -> Result<FileOrFiles>
A folder gives one File per entry, a file gives its own File. Nothing
downloads until asked. path defaults to /.
Sourcepub async fn write(
&self,
path: &str,
data: impl AsRef<[u8]>,
on_progress: Option<Progress>,
) -> Result<File>
pub async fn write( &self, path: &str, data: impl AsRef<[u8]>, on_progress: Option<Progress>, ) -> Result<File>
Create or overwrite a file under /repository, running or not.
Sourcepub async fn rollback(&self, revision: u64) -> Result<()>
pub async fn rollback(&self, revision: u64) -> Result<()>
Record a new revision whose disk is exactly revision’s. Refused while a machine is live.
Sourcepub async fn rename(&self, name: &str) -> Result<Repository>
pub async fn rename(&self, name: &str) -> Result<Repository>
Rename it. Returns the repository with its new name.
pub async fn delete(&self) -> Result<()>
Trait Implementations§
Source§impl Clone for Repository
impl Clone for Repository
Auto Trait Implementations§
impl Forget for Repository
impl Freeze for Repository
impl Move for Repository
impl RefUnwindSafe for Repository
impl Send for Repository
impl Sync for Repository
impl Unpin for Repository
impl UnsafeUnpin for Repository
impl UnwindSafe for Repository
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