pub struct ProjectRegistry {
pub version: String,
pub projects: Vec<RegisteredProject>,
pub next_port: u16,
}Expand description
Global project registry for managing multiple Dashboard instances
Fields§
§version: String§projects: Vec<RegisteredProject>§next_port: u16Implementations§
Source§impl ProjectRegistry
impl ProjectRegistry
Sourcepub fn allocate_port(&mut self) -> Result<u16>
pub fn allocate_port(&mut self) -> Result<u16>
Allocate a new port, checking for conflicts
Sourcepub fn is_port_available(port: u16) -> bool
pub fn is_port_available(port: u16) -> bool
Check if a port is available on the system
Sourcepub fn register(&mut self, project: RegisteredProject)
pub fn register(&mut self, project: RegisteredProject)
Register a new project
Sourcepub fn unregister(&mut self, path: &PathBuf)
pub fn unregister(&mut self, path: &PathBuf)
Unregister a project by path
Sourcepub fn find_by_path(&self, path: &PathBuf) -> Option<&RegisteredProject>
pub fn find_by_path(&self, path: &PathBuf) -> Option<&RegisteredProject>
Find project by path
Sourcepub fn find_by_path_mut(
&mut self,
path: &PathBuf,
) -> Option<&mut RegisteredProject>
pub fn find_by_path_mut( &mut self, path: &PathBuf, ) -> Option<&mut RegisteredProject>
Find project by path (mutable)
Sourcepub fn find_by_port(&self, port: u16) -> Option<&RegisteredProject>
pub fn find_by_port(&self, port: u16) -> Option<&RegisteredProject>
Find project by port
Sourcepub fn list_all(&self) -> &[RegisteredProject]
pub fn list_all(&self) -> &[RegisteredProject]
Get all registered projects
Sourcepub fn cleanup_dead_processes(&mut self)
pub fn cleanup_dead_processes(&mut self)
Clean up projects with dead PIDs
Trait Implementations§
Source§impl Clone for ProjectRegistry
impl Clone for ProjectRegistry
Source§fn clone(&self) -> ProjectRegistry
fn clone(&self) -> ProjectRegistry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProjectRegistry
impl Debug for ProjectRegistry
Source§impl Default for ProjectRegistry
impl Default for ProjectRegistry
Source§impl<'de> Deserialize<'de> for ProjectRegistry
impl<'de> Deserialize<'de> for ProjectRegistry
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
Auto Trait Implementations§
impl Freeze for ProjectRegistry
impl RefUnwindSafe for ProjectRegistry
impl Send for ProjectRegistry
impl Sync for ProjectRegistry
impl Unpin for ProjectRegistry
impl UnwindSafe for ProjectRegistry
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
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>
Converts
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>
Converts
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