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 moreSource§impl Debug for SessionFile
impl Debug for SessionFile
Source§impl<'de> Deserialize<'de> for SessionFile
impl<'de> Deserialize<'de> for SessionFile
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 SessionFile
impl RefUnwindSafe for SessionFile
impl Send for SessionFile
impl Sync for SessionFile
impl Unpin for SessionFile
impl UnsafeUnpin for SessionFile
impl UnwindSafe for SessionFile
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request