pub struct MethodCall<'invoker>(/* private fields */);Expand description
An in-progress method call.
The 'invoker lifetime parameter is the lifetime of the method invoker that is performing the
call.
If a value of this type is dropped, the method call is cancelled. If it has not executed yet, it will not execute; if it has already executed, its result is discarded.
Implementations§
Source§impl<'invoker> MethodCall<'invoker>
impl<'invoker> MethodCall<'invoker>
Sourcepub fn end_length(self) -> InvokeEndLengthResult<'invoker>
pub fn end_length(self) -> InvokeEndLengthResult<'invoker>
Returns the length, in bytes, of the result of the method call, or an indication that the call is not finished.
On success, the length and the MethodCall are returned, allowing the MethodCall to be
reused to fetch the actual bytes.
§Errors
NoSuchComponentis returned if the method call failed because the component does not exist or is inaccessible.NoSuchMethodis returned if the method call failed because the method does not exist on the component.BadParametersis returned if the parameters provided when starting the call are not acceptable for the method.Otheris returned if the method call failed.
Sourcepub unsafe fn end_ptr(
self,
buffer: *mut u8,
len: usize,
) -> InvokeEndResult<'invoker>
pub unsafe fn end_ptr( self, buffer: *mut u8, len: usize, ) -> InvokeEndResult<'invoker>
Returns the result of the method call as a CBOR-encoded data item, or an indication that the call is not finished.
On success, the result is written into up to len bytes pointed to by buffer, and the
number of bytes written is returned. If the buffer is not large enough to hold the call
result, BufferTooShort is returned, containing the
MethodCall object, allowing the caller to retry fetching the results with a larger
buffer, or call end_length to obtain the needed buffer size.
§Errors
NoSuchComponentis returned if the method call failed because the component does not exist or is inaccessible.NoSuchMethodis returned if the method call failed because the method does not exist on the component.BadParametersis returned if the parameters provided when starting the call are not acceptable for the method.Otheris returned if the method call failed.
§Safety
The caller must ensure that len bytes pointed to by buffer are writeable.
Sourcepub fn end(self, buffer: &mut [u8]) -> InvokeEndResult<'invoker>
pub fn end(self, buffer: &mut [u8]) -> InvokeEndResult<'invoker>
Returns the result of the method call as a CBOR-encoded data item, or an indication that the call is not finished.
On success, the result is written into buffer, and the number of bytes written is
returned. If the buffer is not large enough to hold the call result,
BufferTooShort is returned, containing the
MethodCall object, allowing the caller to retry fetching the results with a larger
buffer, or call end_length to obtain the needed buffer size.
§Errors
NoSuchComponentis returned if the method call failed because the component does not exist or is inaccessible.NoSuchMethodis returned if the method call failed because the method does not exist on the component.BadParametersis returned if the parameters provided when starting the call are not acceptable for the method.Otheris returned if the method call failed.
Trait Implementations§
Source§impl<'invoker> Debug for MethodCall<'invoker>
impl<'invoker> Debug for MethodCall<'invoker>
Source§impl Drop for MethodCall<'_>
impl Drop for MethodCall<'_>
impl<'invoker> Eq for MethodCall<'invoker>
Source§impl<'invoker> PartialEq for MethodCall<'invoker>
impl<'invoker> PartialEq for MethodCall<'invoker>
Source§fn eq(&self, other: &MethodCall<'invoker>) -> bool
fn eq(&self, other: &MethodCall<'invoker>) -> bool
self and other values to be equal, and is used by ==.