starpc 0.50.0

Streaming protobuf RPC framework
Documentation
// @generated
// This file is @generated by prost-build.
/// Packet is a message sent over a srpc packet connection.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Packet {
    /// Body is the packet body.
    #[prost(oneof="packet::Body", tags="1, 2, 3")]
    pub body: ::core::option::Option<packet::Body>,
}
/// Nested message and enum types in `Packet`.
pub mod packet {
    /// Body is the packet body.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Body {
        /// CallStart initiates a new call.
        #[prost(message, tag="1")]
        CallStart(super::CallStart),
        /// CallData is a message in a streaming RPC sequence.
        #[prost(message, tag="2")]
        CallData(super::CallData),
        /// CallCancel cancels the call.
        #[prost(bool, tag="3")]
        CallCancel(bool),
    }
}
/// CallStart requests starting a new RPC call.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CallStart {
    /// RpcService is the service to contact.
    /// Must be set.
    #[prost(string, tag="1")]
    pub rpc_service: ::prost::alloc::string::String,
    /// RpcMethod is the RPC method to call.
    /// Must be set.
    #[prost(string, tag="2")]
    pub rpc_method: ::prost::alloc::string::String,
    /// Data contains the request or the first message in the stream.
    /// Optional if streaming.
    #[prost(bytes="vec", tag="3")]
    pub data: ::prost::alloc::vec::Vec<u8>,
    /// DataIsZero indicates Data is set with an empty message.
    #[prost(bool, tag="4")]
    pub data_is_zero: bool,
}
/// CallData contains a message in a streaming RPC sequence.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CallData {
    /// Data contains the packet in the sequence.
    #[prost(bytes="vec", tag="1")]
    pub data: ::prost::alloc::vec::Vec<u8>,
    /// DataIsZero indicates Data is set with an empty message.
    #[prost(bool, tag="2")]
    pub data_is_zero: bool,
    /// Complete indicates the RPC call is completed.
    #[prost(bool, tag="3")]
    pub complete: bool,
    /// Error contains any error that caused the RPC to fail.
    /// If set, implies complete=true.
    #[prost(string, tag="4")]
    pub error: ::prost::alloc::string::String,
}
/// TerminalKind is the terminal state of a held unary invocation.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum TerminalKind {
    /// TERMINAL_KIND_UNSPECIFIED is not a valid terminal state.
    Unspecified = 0,
    /// TERMINAL_KIND_COMMITTED identifies an explicit remote CallData completion.
    Committed = 1,
    /// TERMINAL_KIND_CANCELED identifies a remote CallCancel packet.
    Canceled = 2,
    /// TERMINAL_KIND_TRANSPORT_LOST identifies a remote error or transport failure.
    TransportLost = 3,
    /// TERMINAL_KIND_CLOSED identifies a bare remote close without completion.
    Closed = 4,
    /// TERMINAL_KIND_ABANDONED identifies owner-context expiry without a remote terminal.
    Abandoned = 5,
}
impl TerminalKind {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "TERMINAL_KIND_UNSPECIFIED",
            Self::Committed => "TERMINAL_KIND_COMMITTED",
            Self::Canceled => "TERMINAL_KIND_CANCELED",
            Self::TransportLost => "TERMINAL_KIND_TRANSPORT_LOST",
            Self::Closed => "TERMINAL_KIND_CLOSED",
            Self::Abandoned => "TERMINAL_KIND_ABANDONED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "TERMINAL_KIND_UNSPECIFIED" => Some(Self::Unspecified),
            "TERMINAL_KIND_COMMITTED" => Some(Self::Committed),
            "TERMINAL_KIND_CANCELED" => Some(Self::Canceled),
            "TERMINAL_KIND_TRANSPORT_LOST" => Some(Self::TransportLost),
            "TERMINAL_KIND_CLOSED" => Some(Self::Closed),
            "TERMINAL_KIND_ABANDONED" => Some(Self::Abandoned),
            _ => None,
        }
    }
}
// @@protoc_insertion_point(module)