Skip to content

Instantly share code, notes, and snippets.

@jacobh
Created January 14, 2020 03:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacobh/156144acfcd40b0e18fb51cfff2fd218 to your computer and use it in GitHub Desktop.
Save jacobh/156144acfcd40b0e18fb51cfff2fd218 to your computer and use it in GitHub Desktop.
/// This is a special string which indicates that no response will be received
/// for an RPC.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamingNoResponse {}
/// Generic Ack Message
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Ack {}
/// request the list of available plugins
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PluginListRequest {}
/// Trigger a plugin reload.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PluginReloadRequest {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PluginInfo {
#[prost(int32, required, tag = "1")]
pub plugin_id: i32,
#[prost(string, required, tag = "2")]
pub name: std::string::String,
#[prost(bool, required, tag = "3")]
pub active: bool,
#[prost(bool, optional, tag = "4")]
pub enabled: ::std::option::Option<bool>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PluginListReply {
#[prost(message, repeated, tag = "1")]
pub plugin: ::std::vec::Vec<PluginInfo>,
}
/// request the description for a plugin
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PluginDescriptionRequest {
#[prost(int32, required, tag = "1")]
pub plugin_id: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PluginDescriptionReply {
#[prost(string, required, tag = "1")]
pub name: std::string::String,
#[prost(string, required, tag = "2")]
pub description: std::string::String,
}
/// request the state for a plugin
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PluginStateRequest {
#[prost(int32, required, tag = "1")]
pub plugin_id: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PluginStateReply {
#[prost(string, required, tag = "1")]
pub name: std::string::String,
#[prost(bool, required, tag = "2")]
pub enabled: bool,
#[prost(bool, required, tag = "3")]
pub active: bool,
#[prost(string, required, tag = "4")]
pub preferences_source: std::string::String,
#[prost(message, repeated, tag = "5")]
pub conflicts_with: ::std::vec::Vec<PluginInfo>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PluginStateChangeRequest {
#[prost(int32, required, tag = "1")]
pub plugin_id: i32,
#[prost(bool, required, tag = "2")]
pub enabled: bool,
}
/// request info on a device
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeviceInfoRequest {
#[prost(int32, optional, tag = "1")]
pub plugin_id: ::std::option::Option<i32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PortInfo {
#[prost(int32, required, tag = "1")]
pub port_id: i32,
#[prost(int32, required, tag = "2")]
pub priority_capability: i32,
#[prost(string, required, tag = "5")]
pub description: std::string::String,
#[prost(int32, optional, tag = "3")]
pub universe: ::std::option::Option<i32>,
#[prost(bool, optional, tag = "4")]
pub active: ::std::option::Option<bool>,
#[prost(int32, optional, tag = "6")]
pub priority_mode: ::std::option::Option<i32>,
#[prost(int32, optional, tag = "7")]
pub priority: ::std::option::Option<i32>,
#[prost(bool, optional, tag = "8", default = "false")]
pub supports_rdm: ::std::option::Option<bool>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeviceInfo {
#[prost(int32, required, tag = "1")]
pub device_alias: i32,
#[prost(int32, required, tag = "2")]
pub plugin_id: i32,
#[prost(string, required, tag = "3")]
pub device_name: std::string::String,
#[prost(message, repeated, tag = "4")]
pub input_port: ::std::vec::Vec<PortInfo>,
#[prost(message, repeated, tag = "5")]
pub output_port: ::std::vec::Vec<PortInfo>,
#[prost(string, required, tag = "6")]
pub device_id: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeviceInfoReply {
#[prost(message, repeated, tag = "1")]
pub device: ::std::vec::Vec<DeviceInfo>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DmxData {
#[prost(int32, required, tag = "1")]
pub universe: i32,
#[prost(bytes, required, tag = "2")]
pub data: std::vec::Vec<u8>,
#[prost(int32, optional, tag = "3")]
pub priority: ::std::option::Option<i32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RegisterDmxRequest {
#[prost(int32, required, tag = "1")]
pub universe: i32,
#[prost(enumeration = "RegisterAction", required, tag = "2")]
pub action: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PatchPortRequest {
#[prost(int32, required, tag = "1")]
pub universe: i32,
#[prost(int32, required, tag = "2")]
pub device_alias: i32,
#[prost(int32, required, tag = "3")]
pub port_id: i32,
#[prost(enumeration = "PatchAction", required, tag = "4")]
pub action: i32,
#[prost(bool, required, tag = "5")]
pub is_output: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UniverseNameRequest {
#[prost(int32, required, tag = "1")]
pub universe: i32,
#[prost(string, required, tag = "2")]
pub name: std::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MergeModeRequest {
#[prost(int32, required, tag = "1")]
pub universe: i32,
#[prost(enumeration = "MergeMode", required, tag = "2")]
pub merge_mode: i32,
}
/// request info about a universe
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OptionalUniverseRequest {
#[prost(int32, optional, tag = "1")]
pub universe: ::std::option::Option<i32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UniverseInfo {
#[prost(int32, required, tag = "1")]
pub universe: i32,
#[prost(string, required, tag = "2")]
pub name: std::string::String,
#[prost(enumeration = "MergeMode", required, tag = "3")]
pub merge_mode: i32,
#[prost(int32, required, tag = "4")]
pub input_port_count: i32,
#[prost(int32, required, tag = "5")]
pub output_port_count: i32,
#[prost(int32, required, tag = "6")]
pub rdm_devices: i32,
#[prost(message, repeated, tag = "7")]
pub input_ports: ::std::vec::Vec<PortInfo>,
#[prost(message, repeated, tag = "8")]
pub output_ports: ::std::vec::Vec<PortInfo>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UniverseInfoReply {
#[prost(message, repeated, tag = "1")]
pub universe: ::std::vec::Vec<UniverseInfo>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PortPriorityRequest {
#[prost(int32, required, tag = "1")]
pub device_alias: i32,
#[prost(bool, required, tag = "2")]
pub is_output: bool,
#[prost(int32, required, tag = "3")]
pub port_id: i32,
#[prost(int32, required, tag = "4")]
pub priority_mode: i32,
#[prost(int32, optional, tag = "5")]
pub priority: ::std::option::Option<i32>,
}
/// a device config request
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeviceConfigRequest {
#[prost(int32, required, tag = "1")]
pub device_alias: i32,
#[prost(bytes, required, tag = "2")]
pub data: std::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeviceConfigReply {
#[prost(bytes, required, tag = "1")]
pub data: std::vec::Vec<u8>,
}
/// RDM Messages
/// This represents a UID
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Uid {
/// only lower 2 bytes are used
#[prost(int32, required, tag = "1")]
pub esta_id: i32,
#[prost(fixed32, required, tag = "2")]
pub device_id: u32,
}
/// Request the UID list for a universe
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UniverseRequest {
#[prost(int32, required, tag = "1")]
pub universe: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DiscoveryRequest {
#[prost(int32, required, tag = "1")]
pub universe: i32,
#[prost(bool, required, tag = "2")]
pub full: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UidListReply {
#[prost(int32, required, tag = "1")]
pub universe: i32,
#[prost(message, repeated, tag = "2")]
pub uid: ::std::vec::Vec<Uid>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RdmRequestOverrideOptions {
#[prost(uint32, optional, tag = "1")]
pub sub_start_code: ::std::option::Option<u32>,
#[prost(uint32, optional, tag = "2")]
pub message_length: ::std::option::Option<u32>,
#[prost(uint32, optional, tag = "3")]
pub message_count: ::std::option::Option<u32>,
#[prost(uint32, optional, tag = "4")]
pub checksum: ::std::option::Option<u32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RdmRequest {
#[prost(int32, required, tag = "1")]
pub universe: i32,
#[prost(message, required, tag = "2")]
pub uid: Uid,
#[prost(int32, required, tag = "3")]
pub sub_device: i32,
#[prost(int32, required, tag = "4")]
pub param_id: i32,
/// 0 - 231 bytes
#[prost(bytes, required, tag = "5")]
pub data: std::vec::Vec<u8>,
#[prost(bool, required, tag = "6")]
pub is_set: bool,
#[prost(bool, optional, tag = "7", default = "false")]
pub include_raw_response: ::std::option::Option<bool>,
#[prost(message, optional, tag = "8")]
pub options: ::std::option::Option<RdmRequestOverrideOptions>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RdmDiscoveryRequest {
#[prost(int32, required, tag = "1")]
pub universe: i32,
#[prost(message, required, tag = "2")]
pub uid: Uid,
#[prost(int32, required, tag = "3")]
pub sub_device: i32,
#[prost(int32, required, tag = "4")]
pub param_id: i32,
/// 0 - 231 bytes
#[prost(bytes, required, tag = "5")]
pub data: std::vec::Vec<u8>,
#[prost(bool, optional, tag = "6", default = "false")]
pub include_raw_response: ::std::option::Option<bool>,
#[prost(message, optional, tag = "8")]
pub options: ::std::option::Option<RdmRequestOverrideOptions>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RdmFrameTiming {
#[prost(int32, optional, tag = "1")]
pub response_delay: ::std::option::Option<i32>,
#[prost(int32, optional, tag = "2")]
pub break_time: ::std::option::Option<i32>,
#[prost(int32, optional, tag = "3")]
pub mark_time: ::std::option::Option<i32>,
#[prost(int32, optional, tag = "4")]
pub data_time: ::std::option::Option<i32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RdmFrame {
#[prost(bytes, optional, tag = "1")]
pub raw_response: ::std::option::Option<std::vec::Vec<u8>>,
#[prost(message, optional, tag = "2")]
pub timing: ::std::option::Option<RdmFrameTiming>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RdmResponse {
#[prost(enumeration = "RdmResponseCode", required, tag = "1")]
pub response_code: i32,
#[prost(message, optional, tag = "9")]
pub source_uid: ::std::option::Option<Uid>,
#[prost(message, optional, tag = "10")]
pub dest_uid: ::std::option::Option<Uid>,
#[prost(int32, optional, tag = "11")]
pub transaction_number: ::std::option::Option<i32>,
/// ACK, NACK or TIMER
#[prost(enumeration = "RdmResponseType", optional, tag = "2")]
pub response_type: ::std::option::Option<i32>,
#[prost(uint32, optional, tag = "3", default = "0")]
pub message_count: ::std::option::Option<u32>,
/// the sub device
#[prost(uint32, optional, tag = "7")]
pub sub_device: ::std::option::Option<u32>,
/// the command class
#[prost(enumeration = "RdmCommandClass", optional, tag = "6")]
pub command_class: ::std::option::Option<i32>,
/// the param id, required for queued messages
#[prost(uint32, optional, tag = "5")]
pub param_id: ::std::option::Option<u32>,
/// 0 - 231 bytes
#[prost(bytes, optional, tag = "4", default = "b\"\"")]
pub data: ::std::option::Option<std::vec::Vec<u8>>,
/// deprecated
#[prost(bytes, repeated, tag = "8")]
pub raw_response: ::std::vec::Vec<std::vec::Vec<u8>>,
#[prost(message, repeated, tag = "12")]
pub raw_frame: ::std::vec::Vec<RdmFrame>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TimeCode {
#[prost(uint32, required, tag = "1")]
pub hours: u32,
#[prost(uint32, required, tag = "2")]
pub minutes: u32,
#[prost(uint32, required, tag = "3")]
pub seconds: u32,
#[prost(uint32, required, tag = "4")]
pub frames: u32,
#[prost(enumeration = "TimeCodeType", required, tag = "5")]
pub r#type: i32,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RegisterAction {
Register = 1,
Unregister = 2,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PatchAction {
Patch = 1,
Unpatch = 2,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MergeMode {
Htp = 1,
Ltp = 2,
}
///*
/// Please see the note below about getting a new Plugin ID.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PluginIds {
OlaPluginAll = 0,
OlaPluginDummy = 1,
OlaPluginArtnet = 2,
OlaPluginShownet = 3,
OlaPluginEspnet = 4,
OlaPluginUsbpro = 5,
OlaPluginOpendmx = 6,
OlaPluginSandnet = 7,
OlaPluginStageprofi = 8,
OlaPluginPathport = 9,
OlaPluginDmx4linux = 10,
OlaPluginE131 = 11,
OlaPluginUsbdmx = 12,
OlaPluginFtdidmx = 13,
OlaPluginOsc = 14,
OlaPluginSpi = 15,
OlaPluginKinet = 16,
OlaPluginKarate = 17,
OlaPluginMilinst = 18,
OlaPluginRenard = 19,
OlaPluginUartdmx = 20,
OlaPluginOpenpixelcontrol = 21,
OlaPluginGpio = 22,
OlaPluginSpidmx = 23,
OlaPluginNanoleaf = 24,
}
///*
/// If you add more here be sure to update ResponseCodeToString in RDMHelper.cpp
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RdmResponseCode {
/// The request/response completed correctly
RdmCompletedOk = 0,
/// The request was broadcast, no response expected
RdmWasBroadcast = 1,
/// We failed to send this request
RdmFailedToSend = 2,
/// The response timed out
RdmTimeout = 3,
/// The response was invalid
RdmInvalidResponse = 4,
/// The UID could not be located (may have been removed)
RdmUnknownUid = 5,
/// The response checksum was wrong
RdmChecksumIncorrect = 6,
/// Invalid transaction number
RdmTransactionMismatch = 7,
/// Wrong sub device
RdmSubDeviceMismatch = 8,
///Source UID in response doesn't match
RdmSrcUidMismatch = 9,
///Destination UID in response doesn't match
RdmDestUidMismatch = 10,
///Incorrect sub start code
RdmWrongSubStartCode = 11,
///RDM response was smaller than the minimum size
RdmPacketTooShort = 12,
///The length field of packet didn't match length received
RdmPacketLengthMismatch = 13,
///The parameter length exceeds the remaining packet size
RdmParamLengthMismatch = 14,
///The command class was not one of GET_RESPONSE or SET_RESPONSE
RdmInvalidCommandClass = 15,
///The command class didn't match the request
RdmCommandClassMismatch = 16,
///The response type was not ACK, ACK_OVERFLOW, ACK_TIMER or NACK
RdmInvalidResponseType = 17,
/// The discovery command class is not supported by this device. This
/// typically means the hardware doesn't support discovery commands.
RdmPluginDiscoveryNotSupported = 18,
/// Responses to DUB commands, these responses won't have a defined RDM
/// message, but rather just a string of bytes from the wire.
RdmDubResponse = 19,
}
///*
/// The valid Response Types when the response_code is RDM_COMPLETED_OK.
/// ACK_OVERFLOW isn't in this list because overflows are handed by the plugins,
/// not the clients.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RdmResponseType {
RdmAck = 0,
RdmAckTimer = 1,
/// OVERFLOW can never be returned
RdmNackReason = 2,
}
///*
/// The RDM command class
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum RdmCommandClass {
RdmGetResponse = 0,
RdmSetResponse = 1,
RdmDiscoveryResponse = 2,
}
// timecode
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TimeCodeType {
/// 24fps
TimecodeFilm = 0,
/// 25fps
TimecodeEbu = 1,
/// 29.97fps
TimecodeDf = 2,
/// 30fps
TimecodeSmpte = 3,
}
#[doc = r" Generated server implementations."]
pub mod ola_server_service_client {
#![allow(unused_variables, dead_code, missing_docs)]
use tonic::codegen::*;
#[doc = " RPCs handled by the OLA Server"]
pub struct OlaServerServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl OlaServerServiceClient<tonic::transport::Channel> {
#[doc = r" Attempt to create a new client by connecting to a given endpoint."]
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> OlaServerServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + HttpBody + Send + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as HttpBody>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub async fn get_plugins(
&mut self,
request: impl tonic::IntoRequest<super::PluginListRequest>,
) -> Result<tonic::Response<super::PluginListReply>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/ola.proto.OlaServerService/GetPlugins");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn reload_plugins(
&mut self,
request: impl tonic::IntoRequest<super::PluginReloadRequest>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/ola.proto.OlaServerService/ReloadPlugins");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_plugin_description(
&mut self,
request: impl tonic::IntoRequest<super::PluginDescriptionRequest>,
) -> Result<tonic::Response<super::PluginDescriptionReply>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/ola.proto.OlaServerService/GetPluginDescription",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_plugin_state(
&mut self,
request: impl tonic::IntoRequest<super::PluginStateRequest>,
) -> Result<tonic::Response<super::PluginStateReply>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/ola.proto.OlaServerService/GetPluginState");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_device_info(
&mut self,
request: impl tonic::IntoRequest<super::DeviceInfoRequest>,
) -> Result<tonic::Response<super::DeviceInfoReply>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/ola.proto.OlaServerService/GetDeviceInfo");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_candidate_ports(
&mut self,
request: impl tonic::IntoRequest<super::OptionalUniverseRequest>,
) -> Result<tonic::Response<super::DeviceInfoReply>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/ola.proto.OlaServerService/GetCandidatePorts",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn configure_device(
&mut self,
request: impl tonic::IntoRequest<super::DeviceConfigRequest>,
) -> Result<tonic::Response<super::DeviceConfigReply>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/ola.proto.OlaServerService/ConfigureDevice");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn set_plugin_state(
&mut self,
request: impl tonic::IntoRequest<super::PluginStateChangeRequest>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/ola.proto.OlaServerService/SetPluginState");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn set_port_priority(
&mut self,
request: impl tonic::IntoRequest<super::PortPriorityRequest>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/ola.proto.OlaServerService/SetPortPriority");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_universe_info(
&mut self,
request: impl tonic::IntoRequest<super::OptionalUniverseRequest>,
) -> Result<tonic::Response<super::UniverseInfoReply>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/ola.proto.OlaServerService/GetUniverseInfo");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn set_universe_name(
&mut self,
request: impl tonic::IntoRequest<super::UniverseNameRequest>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/ola.proto.OlaServerService/SetUniverseName");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn set_merge_mode(
&mut self,
request: impl tonic::IntoRequest<super::MergeModeRequest>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/ola.proto.OlaServerService/SetMergeMode");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn patch_port(
&mut self,
request: impl tonic::IntoRequest<super::PatchPortRequest>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/ola.proto.OlaServerService/PatchPort");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn register_for_dmx(
&mut self,
request: impl tonic::IntoRequest<super::RegisterDmxRequest>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/ola.proto.OlaServerService/RegisterForDmx");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn update_dmx_data(
&mut self,
request: impl tonic::IntoRequest<super::DmxData>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/ola.proto.OlaServerService/UpdateDmxData");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_dmx(
&mut self,
request: impl tonic::IntoRequest<super::UniverseRequest>,
) -> Result<tonic::Response<super::DmxData>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/ola.proto.OlaServerService/GetDmx");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn get_ui_ds(
&mut self,
request: impl tonic::IntoRequest<super::UniverseRequest>,
) -> Result<tonic::Response<super::UidListReply>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static("/ola.proto.OlaServerService/GetUIDs");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn force_discovery(
&mut self,
request: impl tonic::IntoRequest<super::DiscoveryRequest>,
) -> Result<tonic::Response<super::UidListReply>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/ola.proto.OlaServerService/ForceDiscovery");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn set_source_uid(
&mut self,
request: impl tonic::IntoRequest<super::Uid>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/ola.proto.OlaServerService/SetSourceUID");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn rdm_command(
&mut self,
request: impl tonic::IntoRequest<super::RdmRequest>,
) -> Result<tonic::Response<super::RdmResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/ola.proto.OlaServerService/RDMCommand");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn rdm_discovery_command(
&mut self,
request: impl tonic::IntoRequest<super::RdmDiscoveryRequest>,
) -> Result<tonic::Response<super::RdmResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/ola.proto.OlaServerService/RDMDiscoveryCommand",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn stream_dmx_data(
&mut self,
request: impl tonic::IntoRequest<super::DmxData>,
) -> Result<tonic::Response<super::StreamingNoResponse>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/ola.proto.OlaServerService/StreamDmxData");
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " timecode"]
pub async fn send_time_code(
&mut self,
request: impl tonic::IntoRequest<super::TimeCode>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/ola.proto.OlaServerService/SendTimeCode");
self.inner.unary(request.into_request(), path, codec).await
}
}
impl<T: Clone> Clone for OlaServerServiceClient<T> {
fn clone(&self) -> Self {
Self {
inner: self.inner.clone(),
}
}
}
}
#[doc = r" Generated server implementations."]
pub mod ola_client_service_client {
#![allow(unused_variables, dead_code, missing_docs)]
use tonic::codegen::*;
#[doc = " RPCs handled by the OLA Client"]
pub struct OlaClientServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl OlaClientServiceClient<tonic::transport::Channel> {
#[doc = r" Attempt to create a new client by connecting to a given endpoint."]
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> OlaClientServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + HttpBody + Send + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as HttpBody>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub async fn update_dmx_data(
&mut self,
request: impl tonic::IntoRequest<super::DmxData>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path =
http::uri::PathAndQuery::from_static("/ola.proto.OlaClientService/UpdateDmxData");
self.inner.unary(request.into_request(), path, codec).await
}
}
impl<T: Clone> Clone for OlaClientServiceClient<T> {
fn clone(&self) -> Self {
Self {
inner: self.inner.clone(),
}
}
}
}
#[doc = r" Generated server implementations."]
pub mod ola_server_service_server {
#![allow(unused_variables, dead_code, missing_docs)]
use tonic::codegen::*;
#[doc = "Generated trait containing gRPC methods that should be implemented for use with OlaServerServiceServer."]
#[async_trait]
pub trait OlaServerService: Send + Sync + 'static {
async fn get_plugins(
&self,
request: tonic::Request<super::PluginListRequest>,
) -> Result<tonic::Response<super::PluginListReply>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn reload_plugins(
&self,
request: tonic::Request<super::PluginReloadRequest>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn get_plugin_description(
&self,
request: tonic::Request<super::PluginDescriptionRequest>,
) -> Result<tonic::Response<super::PluginDescriptionReply>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn get_plugin_state(
&self,
request: tonic::Request<super::PluginStateRequest>,
) -> Result<tonic::Response<super::PluginStateReply>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn get_device_info(
&self,
request: tonic::Request<super::DeviceInfoRequest>,
) -> Result<tonic::Response<super::DeviceInfoReply>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn get_candidate_ports(
&self,
request: tonic::Request<super::OptionalUniverseRequest>,
) -> Result<tonic::Response<super::DeviceInfoReply>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn configure_device(
&self,
request: tonic::Request<super::DeviceConfigRequest>,
) -> Result<tonic::Response<super::DeviceConfigReply>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn set_plugin_state(
&self,
request: tonic::Request<super::PluginStateChangeRequest>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn set_port_priority(
&self,
request: tonic::Request<super::PortPriorityRequest>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn get_universe_info(
&self,
request: tonic::Request<super::OptionalUniverseRequest>,
) -> Result<tonic::Response<super::UniverseInfoReply>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn set_universe_name(
&self,
request: tonic::Request<super::UniverseNameRequest>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn set_merge_mode(
&self,
request: tonic::Request<super::MergeModeRequest>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn patch_port(
&self,
request: tonic::Request<super::PatchPortRequest>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn register_for_dmx(
&self,
request: tonic::Request<super::RegisterDmxRequest>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn update_dmx_data(
&self,
request: tonic::Request<super::DmxData>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn get_dmx(
&self,
request: tonic::Request<super::UniverseRequest>,
) -> Result<tonic::Response<super::DmxData>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn get_ui_ds(
&self,
request: tonic::Request<super::UniverseRequest>,
) -> Result<tonic::Response<super::UidListReply>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn force_discovery(
&self,
request: tonic::Request<super::DiscoveryRequest>,
) -> Result<tonic::Response<super::UidListReply>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn set_source_uid(
&self,
request: tonic::Request<super::Uid>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn rdm_command(
&self,
request: tonic::Request<super::RdmRequest>,
) -> Result<tonic::Response<super::RdmResponse>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn rdm_discovery_command(
&self,
request: tonic::Request<super::RdmDiscoveryRequest>,
) -> Result<tonic::Response<super::RdmResponse>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
async fn stream_dmx_data(
&self,
request: tonic::Request<super::DmxData>,
) -> Result<tonic::Response<super::StreamingNoResponse>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
#[doc = " timecode"]
async fn send_time_code(
&self,
request: tonic::Request<super::TimeCode>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
}
#[doc = " RPCs handled by the OLA Server"]
#[derive(Debug)]
#[doc(hidden)]
pub struct OlaServerServiceServer<T: OlaServerService> {
inner: Arc<T>,
}
impl<T: OlaServerService> OlaServerServiceServer<T> {
pub fn new(inner: T) -> Self {
let inner = Arc::new(inner);
Self { inner }
}
}
impl<T: OlaServerService> Service<http::Request<HyperBody>> for OlaServerServiceServer<T> {
type Response = http::Response<tonic::body::BoxBody>;
type Error = Never;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<HyperBody>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/ola.proto.OlaServerService/GetPlugins" => {
struct GetPluginsSvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService> tonic::server::UnaryService<super::PluginListRequest>
for GetPluginsSvc<T>
{
type Response = super::PluginListReply;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::PluginListRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.get_plugins(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = GetPluginsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/ReloadPlugins" => {
struct ReloadPluginsSvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService>
tonic::server::UnaryService<super::PluginReloadRequest>
for ReloadPluginsSvc<T>
{
type Response = super::Ack;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::PluginReloadRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.reload_plugins(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = ReloadPluginsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/GetPluginDescription" => {
struct GetPluginDescriptionSvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService>
tonic::server::UnaryService<super::PluginDescriptionRequest>
for GetPluginDescriptionSvc<T>
{
type Response = super::PluginDescriptionReply;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::PluginDescriptionRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.get_plugin_description(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = GetPluginDescriptionSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/GetPluginState" => {
struct GetPluginStateSvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService> tonic::server::UnaryService<super::PluginStateRequest>
for GetPluginStateSvc<T>
{
type Response = super::PluginStateReply;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::PluginStateRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.get_plugin_state(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = GetPluginStateSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/GetDeviceInfo" => {
struct GetDeviceInfoSvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService> tonic::server::UnaryService<super::DeviceInfoRequest>
for GetDeviceInfoSvc<T>
{
type Response = super::DeviceInfoReply;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::DeviceInfoRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.get_device_info(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = GetDeviceInfoSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/GetCandidatePorts" => {
struct GetCandidatePortsSvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService>
tonic::server::UnaryService<super::OptionalUniverseRequest>
for GetCandidatePortsSvc<T>
{
type Response = super::DeviceInfoReply;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::OptionalUniverseRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.get_candidate_ports(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = GetCandidatePortsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/ConfigureDevice" => {
struct ConfigureDeviceSvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService>
tonic::server::UnaryService<super::DeviceConfigRequest>
for ConfigureDeviceSvc<T>
{
type Response = super::DeviceConfigReply;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::DeviceConfigRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.configure_device(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = ConfigureDeviceSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/SetPluginState" => {
struct SetPluginStateSvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService>
tonic::server::UnaryService<super::PluginStateChangeRequest>
for SetPluginStateSvc<T>
{
type Response = super::Ack;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::PluginStateChangeRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.set_plugin_state(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = SetPluginStateSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/SetPortPriority" => {
struct SetPortPrioritySvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService>
tonic::server::UnaryService<super::PortPriorityRequest>
for SetPortPrioritySvc<T>
{
type Response = super::Ack;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::PortPriorityRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.set_port_priority(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = SetPortPrioritySvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/GetUniverseInfo" => {
struct GetUniverseInfoSvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService>
tonic::server::UnaryService<super::OptionalUniverseRequest>
for GetUniverseInfoSvc<T>
{
type Response = super::UniverseInfoReply;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::OptionalUniverseRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.get_universe_info(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = GetUniverseInfoSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/SetUniverseName" => {
struct SetUniverseNameSvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService>
tonic::server::UnaryService<super::UniverseNameRequest>
for SetUniverseNameSvc<T>
{
type Response = super::Ack;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::UniverseNameRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.set_universe_name(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = SetUniverseNameSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/SetMergeMode" => {
struct SetMergeModeSvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService> tonic::server::UnaryService<super::MergeModeRequest>
for SetMergeModeSvc<T>
{
type Response = super::Ack;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::MergeModeRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.set_merge_mode(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = SetMergeModeSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/PatchPort" => {
struct PatchPortSvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService> tonic::server::UnaryService<super::PatchPortRequest> for PatchPortSvc<T> {
type Response = super::Ack;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::PatchPortRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.patch_port(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = PatchPortSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/RegisterForDmx" => {
struct RegisterForDmxSvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService> tonic::server::UnaryService<super::RegisterDmxRequest>
for RegisterForDmxSvc<T>
{
type Response = super::Ack;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::RegisterDmxRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.register_for_dmx(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = RegisterForDmxSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/UpdateDmxData" => {
struct UpdateDmxDataSvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService> tonic::server::UnaryService<super::DmxData> for UpdateDmxDataSvc<T> {
type Response = super::Ack;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::DmxData>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.update_dmx_data(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = UpdateDmxDataSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/GetDmx" => {
struct GetDmxSvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService> tonic::server::UnaryService<super::UniverseRequest> for GetDmxSvc<T> {
type Response = super::DmxData;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::UniverseRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.get_dmx(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = GetDmxSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/GetUIDs" => {
struct GetUIDsSvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService> tonic::server::UnaryService<super::UniverseRequest> for GetUIDsSvc<T> {
type Response = super::UidListReply;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::UniverseRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.get_ui_ds(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = GetUIDsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/ForceDiscovery" => {
struct ForceDiscoverySvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService> tonic::server::UnaryService<super::DiscoveryRequest>
for ForceDiscoverySvc<T>
{
type Response = super::UidListReply;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::DiscoveryRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.force_discovery(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = ForceDiscoverySvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/SetSourceUID" => {
struct SetSourceUIDSvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService> tonic::server::UnaryService<super::Uid> for SetSourceUIDSvc<T> {
type Response = super::Ack;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(&mut self, request: tonic::Request<super::Uid>) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.set_source_uid(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = SetSourceUIDSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/RDMCommand" => {
struct RDMCommandSvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService> tonic::server::UnaryService<super::RdmRequest> for RDMCommandSvc<T> {
type Response = super::RdmResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::RdmRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.rdm_command(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = RDMCommandSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/RDMDiscoveryCommand" => {
struct RDMDiscoveryCommandSvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService>
tonic::server::UnaryService<super::RdmDiscoveryRequest>
for RDMDiscoveryCommandSvc<T>
{
type Response = super::RdmResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::RdmDiscoveryRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.rdm_discovery_command(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = RDMDiscoveryCommandSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/StreamDmxData" => {
struct StreamDmxDataSvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService> tonic::server::UnaryService<super::DmxData> for StreamDmxDataSvc<T> {
type Response = super::StreamingNoResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::DmxData>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.stream_dmx_data(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = StreamDmxDataSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/ola.proto.OlaServerService/SendTimeCode" => {
struct SendTimeCodeSvc<T: OlaServerService>(pub Arc<T>);
impl<T: OlaServerService> tonic::server::UnaryService<super::TimeCode> for SendTimeCodeSvc<T> {
type Response = super::Ack;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::TimeCode>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.send_time_code(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = SendTimeCodeSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => Box::pin(async move {
Ok(http::Response::builder()
.status(200)
.header("grpc-status", "12")
.body(tonic::body::BoxBody::empty())
.unwrap())
}),
}
}
}
impl<T: OlaServerService> Clone for OlaServerServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self { inner }
}
}
impl<T: OlaServerService> tonic::transport::ServiceName for OlaServerServiceServer<T> {
const NAME: &'static str = "ola.proto.OlaServerService";
}
}
#[doc = r" Generated server implementations."]
pub mod ola_client_service_server {
#![allow(unused_variables, dead_code, missing_docs)]
use tonic::codegen::*;
#[doc = "Generated trait containing gRPC methods that should be implemented for use with OlaClientServiceServer."]
#[async_trait]
pub trait OlaClientService: Send + Sync + 'static {
async fn update_dmx_data(
&self,
request: tonic::Request<super::DmxData>,
) -> Result<tonic::Response<super::Ack>, tonic::Status> {
Err(tonic::Status::unimplemented("Not yet implemented"))
}
}
#[doc = " RPCs handled by the OLA Client"]
#[derive(Debug)]
#[doc(hidden)]
pub struct OlaClientServiceServer<T: OlaClientService> {
inner: Arc<T>,
}
impl<T: OlaClientService> OlaClientServiceServer<T> {
pub fn new(inner: T) -> Self {
let inner = Arc::new(inner);
Self { inner }
}
}
impl<T: OlaClientService> Service<http::Request<HyperBody>> for OlaClientServiceServer<T> {
type Response = http::Response<tonic::body::BoxBody>;
type Error = Never;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<HyperBody>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/ola.proto.OlaClientService/UpdateDmxData" => {
struct UpdateDmxDataSvc<T: OlaClientService>(pub Arc<T>);
impl<T: OlaClientService> tonic::server::UnaryService<super::DmxData> for UpdateDmxDataSvc<T> {
type Response = super::Ack;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::DmxData>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { inner.update_dmx_data(request).await };
Box::pin(fut)
}
}
let inner = self.inner.clone();
let fut = async move {
let method = UpdateDmxDataSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => Box::pin(async move {
Ok(http::Response::builder()
.status(200)
.header("grpc-status", "12")
.body(tonic::body::BoxBody::empty())
.unwrap())
}),
}
}
}
impl<T: OlaClientService> Clone for OlaClientServiceServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self { inner }
}
}
impl<T: OlaClientService> tonic::transport::ServiceName for OlaClientServiceServer<T> {
const NAME: &'static str = "ola.proto.OlaClientService";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment