pub struct SessionFile {
pub id: Uuid,
pub session_id: Uuid,
pub path: String,
pub name: String,
pub content: Option<String>,
pub encoding: String,
pub is_directory: bool,
pub is_readonly: bool,
pub size_bytes: i64,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Complete file with content
Fields§
§id: UuidInternal database UUID for this file entry.
session_id: UuidUUID of the owning session.
path: StringAbsolute path within the session workspace (e.g. /notes.md).
name: StringFile or directory name (the last segment of path).
content: Option<String>File content. Encoding is controlled by the encoding field: plain UTF-8 text for text, base64-encoded bytes for base64. None for directories and when this is a metadata-only listing.
encoding: StringContent encoding for the content field: text (UTF-8) or base64 (binary).
is_directory: booltrue when this entry represents a directory; false for a regular file.
is_readonly: boolWhether the entry was marked read-only at creation. Read-only entries cannot be edited or deleted by the session.
size_bytes: i64File size in bytes. 0 for directories.
created_at: DateTime<Utc>Timestamp when this entry was created (RFC 3339).
updated_at: DateTime<Utc>Timestamp when this entry was last updated (RFC 3339).
Implementations§
Source§impl SessionFile
impl SessionFile
Sourcepub fn is_text_content(bytes: &[u8]) -> bool
pub fn is_text_content(bytes: &[u8]) -> bool
Check if content is likely text based on bytes
Sourcepub fn encode_content(bytes: &[u8]) -> (String, String)
pub fn encode_content(bytes: &[u8]) -> (String, String)
Convert raw bytes to content string with appropriate encoding
Sourcepub fn decode_content(
content: &str,
encoding: &str,
) -> Result<Vec<u8>, DecodeError>
pub fn decode_content( content: &str, encoding: &str, ) -> Result<Vec<u8>, DecodeError>
Decode content string to raw bytes
Trait Implementations§
Source§impl Clone for SessionFile
impl Clone for SessionFile
Source§fn clone(&self) -> SessionFile
fn clone(&self) -> SessionFile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more