Skip to main content

ProxyBase

Struct ProxyBase 

Source
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>

Source

pub fn new( transport: Arc<T>, service_id: ServiceId, instance_id: InstanceId, method_config: MethodConfig, ) -> Self

Create a new ProxyBase.

Source

pub fn with_defaults( transport: Arc<T>, service_id: ServiceId, instance_id: InstanceId, ) -> Self

Create a new ProxyBase with default MethodConfig.

Source

pub fn transport(&self) -> &Arc<T>

Accessor for the underlying transport (needed by generated code that calls event/field subscription methods directly).

Source

pub fn service_id(&self) -> ServiceId

The SOME/IP service ID this proxy targets.

Source

pub fn instance_id(&self) -> InstanceId

The instance ID this proxy targets.

Source

pub fn method_config(&self) -> &MethodConfig

The default method call configuration (timeout, retries).

Source

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.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.