Skip to main content

Workspace

Struct Workspace 

Source
pub struct Workspace {
Show 22 fields pub name: String, pub id: String, pub image: String, pub user: String, pub cpus: Option<u32>, pub memory: Option<String>, pub root_size: Option<String>, pub home_size: String, pub env: BTreeMap<String, String>, pub secrets: Vec<String>, pub labels: BTreeMap<String, String>, pub token_role: Role, pub home_bind: Option<String>, pub pool: Option<String>, pub created_at: u64, pub created_by: String, pub updated_at: u64, pub rebuilt_at: Option<u64>, pub token: Option<TokenMeta>, pub setup: Option<String>, pub setup_state: Option<SetupState>, pub ports: Vec<PublishedPort>,
}
Expand description

A workspace’s definition.

Fields§

§name: String§id: String

Stable across rebuilds; a new workspace of the same name gets a new one.

§image: String

An incus image (dev-base, images:ubuntu/24.04) or a registry image (registry:APP:TAG).

§user: String

The workspace user: its home is the home volume.

§cpus: Option<u32>§memory: Option<String>§root_size: Option<String>

The root disk’s size; the pool’s default when unset.

§home_size: String§env: BTreeMap<String, String>

Plain variables for login shells (not secrets: use secrets).

§secrets: Vec<String>

Org secrets delivered as files under /run/isb/secrets/<NAME>.

§labels: BTreeMap<String, String>§token_role: Role

The role the workspace’s token has in its org.

§home_bind: Option<String>

A host directory bound as the home instead of a volume: under the daemon’s --workspace-home-root, or a path a superadmin named. isb never deletes it.

§pool: Option<String>

The storage pool the home volume is in, decided at create.

§created_at: u64§created_by: String§updated_at: u64§rebuilt_at: Option<u64>§token: Option<TokenMeta>§setup: Option<String>

A first-boot script: run once as root on the first start after a create or a rebuild, and again on demand. Not for secrets: the definition shows it (use secrets).

§setup_state: Option<SetupState>

Where the setup script is: pending, running, succeeded or failed.

§ports: Vec<PublishedPort>

The ports it publishes (workspace_port_add).

Implementations§

Source§

impl Workspace

Source

pub fn instance(&self) -> &str

The incus instance: the workspace’s name.

Source

pub fn home_volume(&self, org: &OrgId) -> String

The home volume in the org’s project.

Source

pub fn home_dir(&self) -> String

The workspace user’s home directory.

Trait Implementations§

Source§

impl Clone for Workspace

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Workspace

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Workspace

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Workspace

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Workspace

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Workspace

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyEq for T
where T: Any + PartialEq,

Source§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V