pub struct InprocOutGate { /* private fields */ }Expand description
InprocOutGate - Inproc transport adapter (outbound)
§Features
- Zero serialization: directly pass
RpcEnvelopeobjects - Zero copy: use mpsc channel for in-process passing
- PayloadType routing: defaults to Reliable, can specify other types via extension methods
- High performance: latency < 10μs
Implementations§
Source§impl InprocOutGate
impl InprocOutGate
Sourcepub fn new(transport: Arc<InprocTransportManager>) -> Self
pub fn new(transport: Arc<InprocTransportManager>) -> Self
Sourcepub async fn send_request_with_type(
&self,
_target: &ActrId,
payload_type: PayloadType,
identifier: Option<String>,
envelope: RpcEnvelope,
) -> ActorResult<Bytes>
pub async fn send_request_with_type( &self, _target: &ActrId, payload_type: PayloadType, identifier: Option<String>, envelope: RpcEnvelope, ) -> ActorResult<Bytes>
Send request and wait for response (with specified PayloadType and identifier)
§Extension Method
Used for scenarios requiring non-default PayloadType
§Arguments
_target: Target ActorId (only for logging, not needed for intra-process communication)payload_type: PayloadType (Reliable, Signal, LatencyFirst, MediaTrack)identifier: Optional identifier (LatencyFirst needs channel_id, MediaTrack needs track_id)envelope: Message envelope
Sourcepub async fn send_message_with_type(
&self,
_target: &ActrId,
payload_type: PayloadType,
identifier: Option<String>,
envelope: RpcEnvelope,
) -> ActorResult<()>
pub async fn send_message_with_type( &self, _target: &ActrId, payload_type: PayloadType, identifier: Option<String>, envelope: RpcEnvelope, ) -> ActorResult<()>
Send one-way message (with specified PayloadType and identifier)
§Arguments
_target: Target ActorId (only for logging, not needed for intra-process communication)payload_type: PayloadTypeidentifier: Optional identifierenvelope: Message envelope
Sourcepub async fn send_request(
&self,
target: &ActrId,
envelope: RpcEnvelope,
) -> ActorResult<Bytes>
pub async fn send_request( &self, target: &ActrId, envelope: RpcEnvelope, ) -> ActorResult<Bytes>
Sourcepub async fn send_message(
&self,
target: &ActrId,
envelope: RpcEnvelope,
) -> ActorResult<()>
pub async fn send_message( &self, target: &ActrId, envelope: RpcEnvelope, ) -> ActorResult<()>
Sourcepub async fn send_data_stream(
&self,
_target: &ActrId,
payload_type: PayloadType,
data: Bytes,
) -> ActorResult<()>
pub async fn send_data_stream( &self, _target: &ActrId, payload_type: PayloadType, data: Bytes, ) -> ActorResult<()>
Send DataStream (Fast Path)
§Arguments
_target: Target ActorId (for logging only, not needed for intra-process)payload_type: PayloadType (StreamReliable or StreamLatencyFirst)data: Serialized DataStream bytes
§Note
For inproc, DataStream is sent via LatencyFirst channel with stream_id as identifier
Auto Trait Implementations§
impl Freeze for InprocOutGate
impl !RefUnwindSafe for InprocOutGate
impl Send for InprocOutGate
impl Sync for InprocOutGate
impl Unpin for InprocOutGate
impl !UnwindSafe for InprocOutGate
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more