pub struct MemvidEncoder { /* private fields */ }
Expand description
Main encoder for creating QR code videos from text documents
Implementations§
Source§impl MemvidEncoder
impl MemvidEncoder
Sourcepub async fn new(config: Option<Config>) -> Result<Self>
pub async fn new(config: Option<Config>) -> Result<Self>
Create a new encoder with optional configuration
Sourcepub async fn add_text(
&mut self,
text: &str,
chunk_size: usize,
overlap: usize,
) -> Result<()>
pub async fn add_text( &mut self, text: &str, chunk_size: usize, overlap: usize, ) -> Result<()>
Add text content with custom chunk size and overlap
Sourcepub async fn add_pdf<P: AsRef<Path>>(&mut self, pdf_path: P) -> Result<()>
pub async fn add_pdf<P: AsRef<Path>>(&mut self, pdf_path: P) -> Result<()>
Add PDF document content
Sourcepub async fn add_text_file<P: AsRef<Path>>(
&mut self,
file_path: P,
) -> Result<()>
pub async fn add_text_file<P: AsRef<Path>>( &mut self, file_path: P, ) -> Result<()>
Add plain text file content
Sourcepub async fn add_markdown_file<P: AsRef<Path>>(
&mut self,
file_path: P,
) -> Result<()>
pub async fn add_markdown_file<P: AsRef<Path>>( &mut self, file_path: P, ) -> Result<()>
Add markdown file content
Sourcepub async fn build_video(
&mut self,
output_file: &str,
index_file: &str,
) -> Result<EncodingStats>
pub async fn build_video( &mut self, output_file: &str, index_file: &str, ) -> Result<EncodingStats>
Build video from chunks, generating embeddings if enabled
Sourcepub async fn build_video_with_progress<F>(
&mut self,
output_file: &str,
index_file: &str,
progress_callback: F,
) -> Result<EncodingStats>
pub async fn build_video_with_progress<F>( &mut self, output_file: &str, index_file: &str, progress_callback: F, ) -> Result<EncodingStats>
Build video with progress callback
Sourcepub fn get_stats(&self) -> EncodingStats
pub fn get_stats(&self) -> EncodingStats
Get encoding statistics
Sourcepub fn chunk_count(&self) -> usize
pub fn chunk_count(&self) -> usize
Get current chunk count
Sourcepub fn add_chunks(&mut self, chunks: Vec<String>) -> Result<()>
pub fn add_chunks(&mut self, chunks: Vec<String>) -> Result<()>
Add pre-chunked text content directly
Sourcepub fn has_embeddings(&self) -> bool
pub fn has_embeddings(&self) -> bool
Check if embeddings are enabled (always true)
Sourcepub async fn append_chunks(
&mut self,
existing_video_file: &str,
existing_index_file: &str,
new_chunks: Vec<String>,
) -> Result<EncodingStats>
pub async fn append_chunks( &mut self, existing_video_file: &str, existing_index_file: &str, new_chunks: Vec<String>, ) -> Result<EncodingStats>
Append new chunks to an existing video and database (INCREMENTAL UPDATE) This is the core functionality for personal knowledge base use cases
Sourcepub async fn append_conversation_history(
&mut self,
existing_video_file: &str,
existing_index_file: &str,
conversations: Vec<(String, String)>,
) -> Result<EncodingStats>
pub async fn append_conversation_history( &mut self, existing_video_file: &str, existing_index_file: &str, conversations: Vec<(String, String)>, ) -> Result<EncodingStats>
Append chunks from LLM conversation history Specialized for the LLM conversation use case
Sourcepub async fn append_document_chunks(
&mut self,
existing_video_file: &str,
existing_index_file: &str,
document_path: &str,
) -> Result<EncodingStats>
pub async fn append_document_chunks( &mut self, existing_video_file: &str, existing_index_file: &str, document_path: &str, ) -> Result<EncodingStats>
Append chunks from document processing Specialized for the document indexing use case
Auto Trait Implementations§
impl !Freeze for MemvidEncoder
impl !RefUnwindSafe for MemvidEncoder
impl Send for MemvidEncoder
impl Sync for MemvidEncoder
impl Unpin for MemvidEncoder
impl !UnwindSafe for MemvidEncoder
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> 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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.