ydb 0.15.0

Crate contains generated low-level grpc code from YDB API protobuf, used as base for ydb crate
Documentation
use super::{
    scheme::{SchemeIncoming, SchemeReply},
    topic::{TopicIncoming, TopicReply},
};

pub type FromServiceToServerTx = tokio::sync::mpsc::UnboundedSender<Incoming>;
pub type FromServiceToServerRx = tokio::sync::mpsc::UnboundedReceiver<Incoming>;

pub type FromServerToServiceTx = tokio::sync::mpsc::UnboundedSender<Reply>;
pub type FromServerToServiceRx = tokio::sync::mpsc::UnboundedReceiver<Reply>;

pub type FromHandlerToService = FromServerToServiceTx;

#[allow(clippy::large_enum_variant)]
#[derive(Debug)]
pub enum Incoming {
    Topic(TopicIncoming),
    Scheme(SchemeIncoming),
}

#[derive(Debug)]
pub enum Reply {
    Topic(TopicReply),
    Scheme(SchemeReply),
}

pub trait Handler: Send + 'static {
    fn set_channel(&mut self, _tx: FromHandlerToService) {}

    /// Default behavior: let every request through to the service's default
    /// reply policy. Override to absorb (`None`) or rewrite specific messages.
    fn handle(&self, incoming: Incoming) -> Option<Incoming> {
        Some(incoming)
    }
}