pub struct Workspace {
pub id: Uuid,
pub name: String,
pub owner_id: Uuid,
pub created_at: DateTime<Utc>,
pub last_modified_at: DateTime<Utc>,
pub domains: Vec<DomainReference>,
}Expand description
Workspace - Top-level container for domains
Workspaces organize domains and their associated assets. In offline mode, each workspace corresponds to a directory containing domain folders.
Fields§
§id: UuidUnique identifier for the workspace
name: StringWorkspace name
owner_id: UuidOwner/creator user identifier
created_at: DateTime<Utc>Creation timestamp
last_modified_at: DateTime<Utc>Last modification timestamp
domains: Vec<DomainReference>Domain references
Implementations§
Source§impl Workspace
impl Workspace
Sourcepub fn with_id(id: Uuid, name: String, owner_id: Uuid) -> Self
pub fn with_id(id: Uuid, name: String, owner_id: Uuid) -> Self
Create a workspace with a specific ID
Sourcepub fn add_domain(&mut self, domain_id: Uuid, domain_name: String)
pub fn add_domain(&mut self, domain_id: Uuid, domain_name: String)
Add a domain reference to the workspace
Sourcepub fn remove_domain(&mut self, domain_id: Uuid) -> bool
pub fn remove_domain(&mut self, domain_id: Uuid) -> bool
Remove a domain reference by ID
Sourcepub fn get_domain(&self, domain_id: Uuid) -> Option<&DomainReference>
pub fn get_domain(&self, domain_id: Uuid) -> Option<&DomainReference>
Get a domain reference by ID
Sourcepub fn get_domain_by_name(&self, name: &str) -> Option<&DomainReference>
pub fn get_domain_by_name(&self, name: &str) -> Option<&DomainReference>
Get a domain reference by name
Sourcepub fn to_json_pretty(&self) -> Result<String, Error>
pub fn to_json_pretty(&self) -> Result<String, Error>
Export workspace to pretty JSON
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Workspace
impl<'de> Deserialize<'de> for Workspace
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Workspace
Auto Trait Implementations§
impl Freeze for Workspace
impl RefUnwindSafe for Workspace
impl Send for Workspace
impl Sync for Workspace
impl Unpin for Workspace
impl UnwindSafe for Workspace
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