#sdk #dalet #drova

drova_sdk

Sdk for absolute converter of formats for dalet

12 stable releases

new 3.0.1 May 12, 2025
3.0.0 May 11, 2025
2.0.0 May 10, 2025
1.1.0 May 10, 2025

#522 in Text processing

Download history 1560/week @ 2025-05-07

1,560 downloads per month
Used in drova_plugins

MIT license

9KB
156 lines

drova logo

crates.io

DROVA SDK

Absolute SDK for DROVA.

Usage

Install

cargo add drova_sdk

Example

use dalet::types::{Page};
use drova_sdk::requester::{Error, InputHandler, RequesterBuilder};
use async_trait::async_trait;
use drova_sdk::requester::{Error, ProtocolHandler, Response};

pub struct HttpProtocol;

#[async_trait]
impl ProtocolHandler for HttpProtocol {
    async fn fetch(&self, url: &url::Url) -> Result<Response, Error> {
        todo!()
    }
}

pub struct TextInput;

impl InputHandler for TextInput {
    fn process_text(&self, data: String, _: Option<&url::Url>) -> Result<Page, Error> {
        todo!()
    }

    fn process_bytes(&self, _: Vec<u8>, _: Option<&url::Url>) -> Result<Page, Error> {
        todo!()
    }
}

fn main() {
  let requester = RequesterBuilder::default()
        .protocol("http", &HttpProtocol)
        .protocol("https", &HttpProtocol)
        .input("text/plain", &TextInput)
        .input("text/*", &TextInput)
        .build();

  println!("{:#?}", requester.process("http://example.com"))
}

Dependencies

~3–4.5MB
~75K SLoC