pub struct DxSerializer { /* private fields */ }Expand description
DX Serializer for VS Code extension
Provides transformation between LLM (disk) and Human (editor) formats with validation support. Uses the llm module for format conversion.
Implementations§
Source§impl DxSerializer
impl DxSerializer
Sourcepub fn with_config(config: SerializerConfig) -> Self
pub fn with_config(config: SerializerConfig) -> Self
Create a DxSerializer with custom configuration
Sourcepub fn to_human(&self, llm_input: &str) -> TransformResult
pub fn to_human(&self, llm_input: &str) -> TransformResult
Transform LLM format to human-readable format
This is called when opening a .dx file in the editor.
Converts sigil-based LLM format (#c, #:, #<letter>) to beautiful
human-readable format with Unicode tables and expanded keys.
Sourcepub fn to_dense(&self, human_input: &str) -> TransformResult
pub fn to_dense(&self, human_input: &str) -> TransformResult
Transform human-readable format to LLM format
This is called when saving a .dx file in the editor. Converts human-readable format back to token-optimized LLM format.
Sourcepub fn validate(&self, content: &str) -> ValidationResult
pub fn validate(&self, content: &str) -> ValidationResult
Validate content syntax
Returns detailed error information including line, column, and hints.
Sourcepub fn is_saveable(&self, content: &str) -> bool
pub fn is_saveable(&self, content: &str) -> bool
Check if content is complete enough to save
Returns true if the content has no unclosed brackets or strings.
Sourcepub fn max_input_size(&self) -> usize
pub fn max_input_size(&self) -> usize
Get the maximum input size limit (100 MB)
Files larger than this will be rejected to prevent memory exhaustion.
Sourcepub fn max_recursion_depth(&self) -> usize
pub fn max_recursion_depth(&self) -> usize
Get the maximum recursion depth limit (1000 levels)
Structures nested deeper than this will be rejected to prevent stack overflow.
Sourcepub fn max_table_rows(&self) -> usize
pub fn max_table_rows(&self) -> usize
Get the maximum table rows limit (10 million rows)
Tables with more rows than this will be rejected to prevent memory exhaustion.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DxSerializer
impl RefUnwindSafe for DxSerializer
impl Send for DxSerializer
impl Sync for DxSerializer
impl Unpin for DxSerializer
impl UnsafeUnpin for DxSerializer
impl UnwindSafe for DxSerializer
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.