Skip to main content

WaapiClientSync

Struct WaapiClientSync 

Source
pub struct WaapiClientSync { /* private fields */ }
Expand description

Sync WAAPI client.

Provides sync access to the Wwise Authoring API (WAAPI); internally uses a multi-threaded tokio runtime and wraps WaapiClient via block_on.

Explicit disconnect is recommended for graceful shutdown.


WAAPI 同步客户端。推荐显式调用 disconnect

Implementations§

Source§

impl WaapiClientSync

Source

pub fn connect() -> Result<Self, WaapiError>

Connect to WAAPI using the default URL.


使用默认 URL 连接到 WAAPI。

Source

pub fn connect_with_url(url: &str) -> Result<Self, WaapiError>

Connect to WAAPI at the specified URL.


使用指定 URL 连接到 WAAPI。

Source

pub fn call( &self, uri: &str, args: Option<Value>, options: Option<Value>, ) -> Result<Option<Value>, WaapiError>

Call a WAAPI method.


调用 WAAPI 方法。

Source

pub fn subscribe<F>( &self, topic: &str, options: Option<Value>, callback: F, ) -> Result<SubscriptionHandleSync, WaapiError>
where F: Fn(Option<Value>) + Send + Sync + 'static,

Subscribe to a topic with a callback.

To unsubscribe: call SubscriptionHandleSync::unsubscribe or drop the handle. Do not drop the handle inside the callback.


订阅主题并绑定回调。取消订阅:调用返回的 SubscriptionHandleSync::unsubscribe,或 drop 句柄。 不要在 callback 内 drop 句柄。

Source

pub fn is_connected(&self) -> bool

Check whether the client is still logically connected.


检查客户端是否仍处于逻辑连接状态。

Source

pub fn disconnect(self)

Explicitly disconnect.


显式断开连接。

Trait Implementations§

Source§

impl Drop for WaapiClientSync

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V