pub struct LarkDocLoader { /* private fields */ }Expand description
Load Feishu/Lark documents and Wiki pages into Synaptic Documents.
Supports loading specific document tokens directly or traversing a Wiki space to discover all nodes automatically.
§Example
use synaptic_lark::{LarkConfig, LarkDocLoader};
use synaptic_core::Loader;
let config = LarkConfig::new("cli_xxx", "secret_xxx");
let loader = LarkDocLoader::new(config)
.with_doc_tokens(vec!["doxcnAbcXxx".to_string()])
.with_wiki_space_id("space_xxx");
let docs = loader.load().await?;
for doc in &docs {
println!("Title: {}", doc.metadata["title"]);
println!("Content length: {}", doc.content.len());
}Implementations§
Source§impl LarkDocLoader
impl LarkDocLoader
Sourcepub fn new(config: LarkConfig) -> Self
pub fn new(config: LarkConfig) -> Self
Create a new loader using the given config.
Sourcepub fn with_doc_tokens(self, tokens: Vec<String>) -> Self
pub fn with_doc_tokens(self, tokens: Vec<String>) -> Self
Add specific document tokens to load (e.g. "doxcnAbcXxx").
Sourcepub fn with_wiki_space_id(self, space_id: impl Into<String>) -> Self
pub fn with_wiki_space_id(self, space_id: impl Into<String>) -> Self
Traverse a Wiki space to load all documents within it.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LarkDocLoader
impl !RefUnwindSafe for LarkDocLoader
impl Send for LarkDocLoader
impl Sync for LarkDocLoader
impl Unpin for LarkDocLoader
impl UnsafeUnpin for LarkDocLoader
impl !UnwindSafe for LarkDocLoader
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
Mutably borrows from an owned value. Read more