pub struct Workspace {
pub id: EntityId,
pub name: String,
pub description: Option<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub tags: Vec<String>,
pub config: WorkspaceConfig,
pub folders: Vec<Folder>,
pub requests: Vec<MockRequest>,
pub order: i32,
}Will be extracted to mockforge-workspace crate
Expand description
Workspace represents a top-level organizational unit
Fields§
§id: EntityIdWill be extracted to mockforge-workspace crate
Unique identifier
name: StringWill be extracted to mockforge-workspace crate
Human-readable name
description: Option<String>Will be extracted to mockforge-workspace crate
Optional description
created_at: DateTime<Utc>Will be extracted to mockforge-workspace crate
Creation timestamp
updated_at: DateTime<Utc>Will be extracted to mockforge-workspace crate
Last modification timestamp
Will be extracted to mockforge-workspace crate
Associated tags for filtering and organization
config: WorkspaceConfigWill be extracted to mockforge-workspace crate
Configuration specific to this workspace
folders: Vec<Folder>Will be extracted to mockforge-workspace crate
Root folders in this workspace
requests: Vec<MockRequest>Will be extracted to mockforge-workspace crate
Root requests (not in any folder)
order: i32Will be extracted to mockforge-workspace crate
Display order for UI sorting (lower numbers appear first)
Implementations§
Source§impl Workspace
impl Workspace
Sourcepub fn new(name: String) -> Self
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn new(name: String) -> Self
Will be extracted to mockforge-workspace crate
Create a new workspace
Sourcepub fn initialize_default_mock_environments(&mut self)
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn initialize_default_mock_environments(&mut self)
Will be extracted to mockforge-workspace crate
Initialize default mock environments for this workspace This is called when creating a new workspace or when loading an existing one that doesn’t have mock environments configured
Sourcepub fn add_folder(&mut self, name: String) -> Result<EntityId>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn add_folder(&mut self, name: String) -> Result<EntityId>
Will be extracted to mockforge-workspace crate
Add a folder to this workspace
Sourcepub fn create_environment(
&mut self,
name: String,
description: Option<String>,
) -> Result<EntityId>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn create_environment( &mut self, name: String, description: Option<String>, ) -> Result<EntityId>
Will be extracted to mockforge-workspace crate
Create a new environment
Sourcepub fn get_environments(&self) -> Vec<&Environment>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn get_environments(&self) -> Vec<&Environment>
Will be extracted to mockforge-workspace crate
Get all environments (global + sub-environments)
Sourcepub fn get_environment(&self, id: &str) -> Option<&Environment>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn get_environment(&self, id: &str) -> Option<&Environment>
Will be extracted to mockforge-workspace crate
Get environment by ID
Sourcepub fn get_environment_mut(&mut self, id: &str) -> Option<&mut Environment>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn get_environment_mut(&mut self, id: &str) -> Option<&mut Environment>
Will be extracted to mockforge-workspace crate
Get environment by ID (mutable)
Sourcepub fn set_active_environment(
&mut self,
environment_id: Option<String>,
) -> Result<()>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn set_active_environment( &mut self, environment_id: Option<String>, ) -> Result<()>
Will be extracted to mockforge-workspace crate
Set active environment
Sourcepub fn get_active_environment(&self) -> &Environment
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn get_active_environment(&self) -> &Environment
Will be extracted to mockforge-workspace crate
Get active environment (returns global if no sub-environment is active)
Sourcepub fn get_active_environment_id(&self) -> Option<&str>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn get_active_environment_id(&self) -> Option<&str>
Will be extracted to mockforge-workspace crate
Get active environment ID
Sourcepub fn get_variable(&self, key: &str) -> Option<&String>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn get_variable(&self, key: &str) -> Option<&String>
Will be extracted to mockforge-workspace crate
Get variable value from current active environment
Sourcepub fn get_all_variables(&self) -> HashMap<String, String>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn get_all_variables(&self) -> HashMap<String, String>
Will be extracted to mockforge-workspace crate
Get all variables from current active environment context
Sourcepub fn delete_environment(&mut self, id: &str) -> Result<()>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn delete_environment(&mut self, id: &str) -> Result<()>
Will be extracted to mockforge-workspace crate
Delete an environment
Sourcepub fn update_environments_order(
&mut self,
environment_ids: Vec<String>,
) -> Result<()>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn update_environments_order( &mut self, environment_ids: Vec<String>, ) -> Result<()>
Will be extracted to mockforge-workspace crate
Update the order of environments
Sourcepub fn get_environments_ordered(&self) -> Vec<&Environment>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn get_environments_ordered(&self) -> Vec<&Environment>
Will be extracted to mockforge-workspace crate
Get environments sorted by order
Sourcepub fn get_mock_environments(&self) -> &MockEnvironmentManager
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn get_mock_environments(&self) -> &MockEnvironmentManager
Will be extracted to mockforge-workspace crate
Get the mock environment manager
Sourcepub fn get_mock_environments_mut(&mut self) -> &mut MockEnvironmentManager
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn get_mock_environments_mut(&mut self) -> &mut MockEnvironmentManager
Will be extracted to mockforge-workspace crate
Get mutable access to the mock environment manager
Sourcepub fn get_mock_environment(
&self,
name: MockEnvironmentName,
) -> Option<&MockEnvironment>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn get_mock_environment( &self, name: MockEnvironmentName, ) -> Option<&MockEnvironment>
Will be extracted to mockforge-workspace crate
Get a specific mock environment by name
Sourcepub fn get_active_mock_environment(&self) -> Option<&MockEnvironment>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn get_active_mock_environment(&self) -> Option<&MockEnvironment>
Will be extracted to mockforge-workspace crate
Get the active mock environment
Sourcepub fn set_active_mock_environment(
&mut self,
name: MockEnvironmentName,
) -> Result<()>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn set_active_mock_environment( &mut self, name: MockEnvironmentName, ) -> Result<()>
Will be extracted to mockforge-workspace crate
Set the active mock environment
Sourcepub fn list_mock_environments(&self) -> Vec<&MockEnvironment>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn list_mock_environments(&self) -> Vec<&MockEnvironment>
Will be extracted to mockforge-workspace crate
List all mock environments
Sourcepub fn set_mock_environment_config(
&mut self,
name: MockEnvironmentName,
reality_config: Option<RealityConfig>,
chaos_config: Option<ChaosConfig>,
drift_budget_config: Option<DriftBudgetConfig>,
) -> Result<()>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn set_mock_environment_config( &mut self, name: MockEnvironmentName, reality_config: Option<RealityConfig>, chaos_config: Option<ChaosConfig>, drift_budget_config: Option<DriftBudgetConfig>, ) -> Result<()>
Will be extracted to mockforge-workspace crate
Add or update a mock environment configuration
Sourcepub fn configure_sync(&mut self, config: SyncConfig) -> Result<()>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn configure_sync(&mut self, config: SyncConfig) -> Result<()>
Will be extracted to mockforge-workspace crate
Configure directory sync for this workspace
Sourcepub fn enable_sync(&mut self, target_directory: String) -> Result<()>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn enable_sync(&mut self, target_directory: String) -> Result<()>
Will be extracted to mockforge-workspace crate
Enable directory sync with default settings
Sourcepub fn disable_sync(&mut self) -> Result<()>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn disable_sync(&mut self) -> Result<()>
Will be extracted to mockforge-workspace crate
Disable directory sync
Sourcepub fn get_sync_config(&self) -> &SyncConfig
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn get_sync_config(&self) -> &SyncConfig
Will be extracted to mockforge-workspace crate
Get sync configuration
Sourcepub fn is_sync_enabled(&self) -> bool
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn is_sync_enabled(&self) -> bool
Will be extracted to mockforge-workspace crate
Check if sync is enabled
Sourcepub fn get_sync_directory(&self) -> Option<&str>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn get_sync_directory(&self) -> Option<&str>
Will be extracted to mockforge-workspace crate
Get the target sync directory
Sourcepub fn set_sync_directory(&mut self, directory: Option<String>) -> Result<()>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn set_sync_directory(&mut self, directory: Option<String>) -> Result<()>
Will be extracted to mockforge-workspace crate
Set sync directory
Sourcepub fn set_sync_direction(&mut self, direction: SyncDirection) -> Result<()>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn set_sync_direction(&mut self, direction: SyncDirection) -> Result<()>
Will be extracted to mockforge-workspace crate
Set sync direction
Sourcepub fn get_sync_direction(&self) -> &SyncDirection
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn get_sync_direction(&self) -> &SyncDirection
Will be extracted to mockforge-workspace crate
Get sync direction
Sourcepub fn set_realtime_monitoring(&mut self, enabled: bool) -> Result<()>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn set_realtime_monitoring(&mut self, enabled: bool) -> Result<()>
Will be extracted to mockforge-workspace crate
Enable/disable real-time monitoring
Sourcepub fn is_realtime_monitoring_enabled(&self) -> bool
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn is_realtime_monitoring_enabled(&self) -> bool
Will be extracted to mockforge-workspace crate
Check if real-time monitoring is enabled
Sourcepub fn to_filtered_for_sync(&self) -> Workspace
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn to_filtered_for_sync(&self) -> Workspace
Will be extracted to mockforge-workspace crate
Create filtered copy for directory sync (removes sensitive environments and non-sharable environments)
Sourcepub fn should_sync(&self) -> bool
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn should_sync(&self) -> bool
Will be extracted to mockforge-workspace crate
Check if this workspace should be included in directory sync
Sourcepub fn get_sync_filename(&self) -> String
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn get_sync_filename(&self) -> String
Will be extracted to mockforge-workspace crate
Get the filename for this workspace in directory sync
Source§impl Workspace
impl Workspace
Sourcepub fn find_folder(&self, id: &str) -> Option<&Folder>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn find_folder(&self, id: &str) -> Option<&Folder>
Will be extracted to mockforge-workspace crate
Find a folder by ID recursively
Sourcepub fn find_folder_mut(&mut self, id: &str) -> Option<&mut Folder>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn find_folder_mut(&mut self, id: &str) -> Option<&mut Folder>
Will be extracted to mockforge-workspace crate
Find a folder by ID recursively (mutable)
Sourcepub fn add_request(&mut self, request: MockRequest) -> Result<EntityId>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn add_request(&mut self, request: MockRequest) -> Result<EntityId>
Will be extracted to mockforge-workspace crate
Add a request to this workspace
Sourcepub fn get_routes(&self) -> Vec<Route>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn get_routes(&self) -> Vec<Route>
Will be extracted to mockforge-workspace crate
Get all routes from this workspace
Sourcepub fn get_effective_auth<'a>(
&'a self,
folder_path: &[&'a Folder],
) -> Option<&'a AuthConfig>
👎Deprecated: Will be extracted to mockforge-workspace crate
pub fn get_effective_auth<'a>( &'a self, folder_path: &[&'a Folder], ) -> Option<&'a AuthConfig>
Will be extracted to mockforge-workspace crate
Get effective authentication for a request at the given path
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>,
Auto Trait Implementations§
impl Freeze for Workspace
impl RefUnwindSafe for Workspace
impl Send for Workspace
impl Sync for Workspace
impl Unpin for Workspace
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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