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
impl WaapiClientSync
Sourcepub fn connect() -> Result<Self, WaapiError>
pub fn connect() -> Result<Self, WaapiError>
Connect to WAAPI using the default URL.
使用默认 URL 连接到 WAAPI。
Sourcepub fn connect_with_url(url: &str) -> Result<Self, WaapiError>
pub fn connect_with_url(url: &str) -> Result<Self, WaapiError>
Connect to WAAPI at the specified URL.
使用指定 URL 连接到 WAAPI。
Sourcepub fn call(
&self,
uri: &str,
args: Option<Value>,
options: Option<Value>,
) -> Result<Option<Value>, WaapiError>
pub fn call( &self, uri: &str, args: Option<Value>, options: Option<Value>, ) -> Result<Option<Value>, WaapiError>
Call a WAAPI method.
调用 WAAPI 方法。
Sourcepub fn subscribe<F>(
&self,
topic: &str,
options: Option<Value>,
callback: F,
) -> Result<SubscriptionHandleSync, WaapiError>
pub fn subscribe<F>( &self, topic: &str, options: Option<Value>, callback: F, ) -> Result<SubscriptionHandleSync, WaapiError>
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 句柄。
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check whether the client is still logically connected.
检查客户端是否仍处于逻辑连接状态。
Sourcepub fn disconnect(self)
pub fn disconnect(self)
Explicitly disconnect.
显式断开连接。
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WaapiClientSync
impl !RefUnwindSafe for WaapiClientSync
impl Send for WaapiClientSync
impl Sync for WaapiClientSync
impl Unpin for WaapiClientSync
impl UnsafeUnpin for WaapiClientSync
impl !UnwindSafe for WaapiClientSync
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