pub struct ProxyBase<T: Transport> { /* private fields */ }Expand description
Base proxy that generated proxies wrap.
Holds transport, identity, and default method configuration. Generated
proxy structs embed a ProxyBase<T> and delegate all wire-level calls to
its helper methods.
Implementations§
Source§impl<T: Transport> ProxyBase<T>
impl<T: Transport> ProxyBase<T>
Sourcepub fn new(
transport: Arc<T>,
service_id: ServiceId,
instance_id: InstanceId,
method_config: MethodConfig,
) -> Self
pub fn new( transport: Arc<T>, service_id: ServiceId, instance_id: InstanceId, method_config: MethodConfig, ) -> Self
Create a new ProxyBase.
Sourcepub fn with_defaults(
transport: Arc<T>,
service_id: ServiceId,
instance_id: InstanceId,
) -> Self
pub fn with_defaults( transport: Arc<T>, service_id: ServiceId, instance_id: InstanceId, ) -> Self
Create a new ProxyBase with default MethodConfig.
Sourcepub fn transport(&self) -> &Arc<T>
pub fn transport(&self) -> &Arc<T>
Accessor for the underlying transport (needed by generated code that calls event/field subscription methods directly).
Sourcepub fn service_id(&self) -> ServiceId
pub fn service_id(&self) -> ServiceId
The SOME/IP service ID this proxy targets.
Sourcepub fn instance_id(&self) -> InstanceId
pub fn instance_id(&self) -> InstanceId
The instance ID this proxy targets.
Sourcepub fn method_config(&self) -> &MethodConfig
pub fn method_config(&self) -> &MethodConfig
The default method call configuration (timeout, retries).
Sourcepub async fn call_method<Req, Resp>(
&self,
method_id: MethodId,
request: &Req,
) -> MethodResult<Resp>where
Req: AraSerialize,
Resp: AraDeserialize,
pub async fn call_method<Req, Resp>(
&self,
method_id: MethodId,
request: &Req,
) -> MethodResult<Resp>where
Req: AraSerialize,
Resp: AraDeserialize,
Encode request, dispatch it via the transport, then decode the
response payload into Resp.
This is the primary helper used by generated proxy method stubs.
Sourcepub async fn call_fire_and_forget<Req>(
&self,
method_id: MethodId,
request: &Req,
) -> MethodResult<()>where
Req: AraSerialize,
pub async fn call_fire_and_forget<Req>(
&self,
method_id: MethodId,
request: &Req,
) -> MethodResult<()>where
Req: AraSerialize,
Send a fire-and-forget (no-return) method call.
Auto Trait Implementations§
impl<T> Freeze for ProxyBase<T>
impl<T> RefUnwindSafe for ProxyBase<T>where
T: RefUnwindSafe,
impl<T> Send for ProxyBase<T>
impl<T> Sync for ProxyBase<T>
impl<T> Unpin for ProxyBase<T>
impl<T> UnsafeUnpin for ProxyBase<T>
impl<T> UnwindSafe for ProxyBase<T>where
T: RefUnwindSafe,
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
Mutably borrows from an owned value. Read more