pub struct RemoteServerClient<R: ReadWrite> { /* private fields */ }Expand description
Client for communicating with iOS remote server protocol
Manages multiple communication channels and handles message serialization/deserialization. Each channel operates independently and maintains its own message queue.
Implementations§
Source§impl<R: ReadWrite> RemoteServerClient<R>
impl<R: ReadWrite> RemoteServerClient<R>
Sourcepub fn root_channel<'c>(&'c mut self) -> Channel<'c, R>
pub fn root_channel<'c>(&'c mut self) -> Channel<'c, R>
Returns a handle to the root channel (channel 0)
Sourcepub async fn make_channel<'c>(
&'c mut self,
identifier: impl Into<String>,
) -> Result<Channel<'c, R>, IdeviceError>
pub async fn make_channel<'c>( &'c mut self, identifier: impl Into<String>, ) -> Result<Channel<'c, R>, IdeviceError>
Creates a new channel with the given identifier
§Arguments
identifier- String identifier for the new channel
§Returns
Ok(Channel)- Handle to the new channelErr(IdeviceError)- If channel creation fails
§Errors
- `IdeviceError::UnexpectedResponse(“unexpected response”.into()) if server responds with unexpected data
- Other IO or serialization errors
Sourcepub async fn call_method(
&mut self,
channel: i32,
data: Option<impl Into<Value>>,
args: Option<Vec<AuxValue>>,
expect_reply: bool,
) -> Result<(), IdeviceError>
pub async fn call_method( &mut self, channel: i32, data: Option<impl Into<Value>>, args: Option<Vec<AuxValue>>, expect_reply: bool, ) -> Result<(), IdeviceError>
Calls a method on the specified channel
§Arguments
channel- Channel number to call method ondata- Optional method data (plist value)args- Optional arguments for the methodexpect_reply- Whether to expect a response
§Returns
Ok(())- If method was successfully calledErr(IdeviceError)- If call failed
§Errors
IO or serialization errors
Sourcepub async fn read_message(
&mut self,
channel: i32,
) -> Result<Message, IdeviceError>
pub async fn read_message( &mut self, channel: i32, ) -> Result<Message, IdeviceError>
Reads the next message from the specified channel
Checks cached messages first, then reads from transport if needed.
§Arguments
channel- Channel number to read from
§Returns
Ok(Message)- The received messageErr(IdeviceError)- If read failed
§Errors
IdeviceError::UnknownChannelif channel doesn’t exist- Other IO or deserialization errors
Source§impl RemoteServerClient<Box<dyn ReadWrite>>
impl RemoteServerClient<Box<dyn ReadWrite>>
Trait Implementations§
Source§impl<R: ReadWrite> Debug for RemoteServerClient<R>
impl<R: ReadWrite> Debug for RemoteServerClient<R>
Source§impl<R: ReadWrite> Drop for RemoteServerClient<R>
impl<R: ReadWrite> Drop for RemoteServerClient<R>
Source§impl IdeviceService for RemoteServerClient<Box<dyn ReadWrite>>
impl IdeviceService for RemoteServerClient<Box<dyn ReadWrite>>
Source§fn service_name() -> Cow<'static, str>
fn service_name() -> Cow<'static, str>
Returns the service name as advertised by the device
Source§async fn connect(provider: &dyn IdeviceProvider) -> Result<Self, IdeviceError>
async fn connect(provider: &dyn IdeviceProvider) -> Result<Self, IdeviceError>
Establishes a connection to this service Read more
async fn from_stream(idevice: Idevice) -> Result<Self, IdeviceError>
Source§impl RsdService for RemoteServerClient<Box<dyn ReadWrite>>
impl RsdService for RemoteServerClient<Box<dyn ReadWrite>>
fn rsd_service_name() -> Cow<'static, str>
async fn from_stream(stream: Box<dyn ReadWrite>) -> Result<Self, IdeviceError>
fn connect_rsd(
provider: &mut impl RsdProvider,
handshake: &mut RsdHandshake,
) -> impl Future<Output = Result<Self, IdeviceError>>where
Self: RsdService,
Auto Trait Implementations§
impl<R> !RefUnwindSafe for RemoteServerClient<R>
impl<R> !UnwindSafe for RemoteServerClient<R>
impl<R> Freeze for RemoteServerClient<R>
impl<R> Send for RemoteServerClient<R>
impl<R> Sync for RemoteServerClient<R>
impl<R> Unpin for RemoteServerClient<R>
impl<R> UnsafeUnpin for RemoteServerClient<R>
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