Skip to main content

braid_core/core/server/
send_update.rs

1//! Send update response implementation for Braid protocol.
2
3use crate::core::error::Result;
4use crate::core::protocol_mod as protocol;
5use crate::core::protocol_mod::constants::{headers, media_types};
6use crate::core::{Update, Version};
7use axum::{
8    body::Body,
9    http::{header, HeaderValue, StatusCode},
10    response::{IntoResponse, Response},
11};
12use bytes::Bytes;
13use std::collections::BTreeMap;
14
15/// Extension trait for Axum responses to send Braid updates.
16pub trait SendUpdateExt {
17    fn send_update(&mut self, update: &Update) -> Result<()>;
18    fn send_body(&mut self, body: &[u8]) -> Result<()>;
19}
20
21// UpdateResponse and IntoResponse are now implemented in braid-http