weave-browser-engine · fetch
Source declarations, signatures and documentation for fetch.
Reviewed implementation boundary: The serve path warns but still binds when WEAVE_API_KEY is absent; the authentication check then allows requests. Configure and verify authorization before exposing a server. See /libraries/weave-browser-engine/research-server.
Source: sigil/weave/libs/weave-browser-engine/src/fetch.rs. SHA-256: eb0e092d0d6004061ff0de0d9c0ce5ea0440a317618c515f9d830f5faacfab4c.
This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.
fetch::FetchOptions
Options controlling what data the fetch operation should extract.
#[derive(Debug, Clone, Default)]
pub struct FetchOptions {
/// Include the raw HTML body in the result.
pub include_raw: bool,
/// Extract all `<a>` links.
pub extract_links: bool,
/// Extract all `<img>` images.
pub extract_images: bool,
/// A CSS selector to extract specific elements.
pub css_selector: Option<String>
}Source line: 15.
fetch::fetch_url
Fetch a URL, parse it, and return structured JSON.
Supports http://, https://, and weave:// protocols. For weave:
URLs, reads from the local filesystem fallback at ~/.dbrowser/sites/.
Returns a JSON object with:
url,status,content_type,title,description,text,word_count- Optionally:
raw_html,links,images,selected,structured_data
pub async fn fetch_url(url: &str, options: &FetchOptions) -> BrowserResult<Value>;Source line: 34.