Async protocol server for the Tauri desktop client, handling lint requests and shared configuration state.
// Source: https://github.com/mperkins0155/harper | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
use crate::config::Config;
use harper_core::{DictWordMetadata, spell::Dictionary};
use std::sync::Arc;
use tokio::io::{AsyncBufReadExt, AsyncRead, AsyncWrite, BufReader};
use tokio::sync::Mutex;
use super::error::ProtocolError;
use super::framing::write_message;
use super::message::{Request, Response};
/// Tauri-side protocol endpoint that owns shared state and responds to highlighter requests.
pub struct Server<R, W> {
reader: BufReader<R>,
writer: W,
config: Arc<Mutex<Config>>,
}
impl<R, W> Server<R, W>
where
R: AsyncRead + Unpin,
W: AsyncWrite + Unpin,
{
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key