pub struct ProjectMeta {Show 13 fields
pub project_id: String,
pub name: String,
pub path: PathBuf,
pub imported_at: String,
pub last_accessed: String,
pub file_count: usize,
pub total_lines: usize,
pub description: Option<String>,
pub tags: Vec<String>,
pub has_config: bool,
pub socket: Option<PathBuf>,
pub server_pid: Option<u32>,
pub server_options: ProjectServerOptions,
}Expand description
Metadata for an imported project.
Fields§
§project_id: StringUnique project identifier (UUID).
name: StringDisplay name of the project.
path: PathBufProject path on disk.
imported_at: StringWhen the project was imported (ISO 8601).
last_accessed: StringLast time the project was accessed.
file_count: usizeNumber of files in the project.
total_lines: usizeTotal lines of code.
description: Option<String>Description (from ryo.toml or auto-generated).
Tags for categorization.
has_config: boolWhether ryo.toml exists.
socket: Option<PathBuf>Unix socket path for this project’s server. Generated from project_id: /tmp/ryo-{project_id[..8]}.sock
server_pid: Option<u32>Process ID of the running server (None if not running).
server_options: ProjectServerOptionsPer-project server options (overrides global config).
Implementations§
Source§impl ProjectMeta
impl ProjectMeta
Sourcepub fn new(
project_id: String,
name: String,
path: PathBuf,
file_count: usize,
total_lines: usize,
) -> Self
pub fn new( project_id: String, name: String, path: PathBuf, file_count: usize, total_lines: usize, ) -> Self
Create new project metadata.
The path is automatically canonicalized to ensure consistent lookups. If canonicalization fails (e.g., path doesn’t exist), the original path is used.
Sourcepub fn generate_socket_path(project_id: &str) -> PathBuf
pub fn generate_socket_path(project_id: &str) -> PathBuf
Generate socket path from project ID. Format: /tmp/ryo-{project_id[..8]}.sock
Sourcepub fn socket_path(&self) -> PathBuf
pub fn socket_path(&self) -> PathBuf
Get socket path, generating if not set.
Sourcepub fn is_server_running(&self) -> bool
pub fn is_server_running(&self) -> bool
Check if server is running (process exists).
Sourcepub fn set_server_pid(&mut self, pid: Option<u32>)
pub fn set_server_pid(&mut self, pid: Option<u32>)
Set server PID.
Sourcepub fn cleanup_dead_server(&mut self) -> bool
pub fn cleanup_dead_server(&mut self) -> bool
Clear server PID if process is dead.
Sourcepub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
Add a description.
Add tags.
Sourcepub fn with_config(self, has_config: bool) -> Self
pub fn with_config(self, has_config: bool) -> Self
Set config presence.
Trait Implementations§
Source§impl Clone for ProjectMeta
impl Clone for ProjectMeta
Source§fn clone(&self) -> ProjectMeta
fn clone(&self) -> ProjectMeta
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProjectMeta
impl Debug for ProjectMeta
Source§impl<'de> Deserialize<'de> for ProjectMeta
impl<'de> Deserialize<'de> for ProjectMeta
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 ProjectMeta
impl RefUnwindSafe for ProjectMeta
impl Send for ProjectMeta
impl Sync for ProjectMeta
impl Unpin for ProjectMeta
impl UnsafeUnpin for ProjectMeta
impl UnwindSafe for ProjectMeta
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> 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