pub struct Repository {
pub id: u64,
pub name: String,
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 revisions(). Start it with os::MachineRoom::start.
Fields§
§id: u64§name: String§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 revisions(&self, query: PageQuery) -> Result<Vec<Revision>>
pub async fn revisions(&self, query: PageQuery) -> Result<Vec<Revision>>
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. A stopped machine takes it when it next starts, still resuming where it left off, and reads show it meanwhile.
Sourcepub async fn rollback(&self, index: u64) -> Result<()>
pub async fn rollback(&self, index: u64) -> Result<()>
Record a new revision whose disk is exactly revision index’s, dropping writes waiting for
the next start. 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.