pub enum Payload {
Config(WebSocketConfig),
Start(SynthesisRequest),
Text(String),
End(WebSocketEnd),
Cancel(WebSocketCancel),
}Variants§
Config(WebSocketConfig)
Connection-level configuration. At most one, and only before the first
start. Not required in debug mode or when the upgrade request
carried an Authorization header.
Start(SynthesisRequest)
Opens the context with the full synthesis parameters. A non-empty
text is the complete input for one-shot synthesis: audio streams
and ends with done, no end required. An empty text opens a
streaming context that stays open for text messages and finalizes
on end.
Text(String)
Appends a chunk of input text to an open streaming context (one opened
with an empty start.text). The engine meters, segments, and
synthesizes it into the same continuous audio as it arrives. Rejected
with kind “invalid_input” if the context is not open for input (no
start, or already ended / one-shot).
End(WebSocketEnd)
Declares end of input for a streaming context. Remaining audio is
delivered, followed by done. A no-op for a one-shot context. The
connection stays open for further contexts.
Cancel(WebSocketCancel)
Aborts the context immediately, discarding in-flight synthesis.
Acknowledged with cancelled; idempotent (cancelling an unknown or
finished context is not an error).
Implementations§
Source§impl Payload
impl Payload
Sourcepub fn merge(
field: &mut Option<Payload>,
tag: u32,
wire_type: WireType,
buf: &mut impl Buf,
ctx: DecodeContext,
) -> Result<(), DecodeError>
pub fn merge( field: &mut Option<Payload>, tag: u32, wire_type: WireType, buf: &mut impl Buf, ctx: DecodeContext, ) -> Result<(), DecodeError>
Decodes an instance of the message from a buffer, and merges it into self.
Sourcepub fn encoded_len(&self) -> usize
pub fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Trait Implementations§
impl StructuralPartialEq for Payload
Auto Trait Implementations§
impl Freeze for Payload
impl RefUnwindSafe for Payload
impl Send for Payload
impl Sync for Payload
impl Unpin for Payload
impl UnsafeUnpin for Payload
impl UnwindSafe for Payload
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request