pub struct ThreadProxy { /* private fields */ }
Implementations§
Source§impl ThreadProxy
impl ThreadProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.lowpan.bootstrap/Thread.
Sourcepub fn take_event_stream(&self) -> ThreadEventStream
pub fn take_event_stream(&self) -> ThreadEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn import_settings(
&self,
thread_settings_json: Buffer,
) -> QueryResponseFut<(), DefaultFuchsiaResourceDialect>
pub fn import_settings( &self, thread_settings_json: Buffer, ) -> QueryResponseFut<(), DefaultFuchsiaResourceDialect>
Import a json data file containing the Thread configuration as created by [ThreadConfigManager] (https://fuchsia.googlesource.com/fuchsia/+/refs/heads/master/src/connectivity/openthread/third_party/openthread/platform/thread_config_manager.cc). The json format is: { “key1” : [ base64_encoded_string1_1, base64_encoded_string1_2, … ], “key2” : [ base64_encoded_string2_1, base64_encoded_string2_2, … ], … } where key1, key2 etc are decimal representation of uint16_t values. base64_encoded_strings are created from a vector of uint16_t values. This json format is equivalent to thread settings file in POSIX which is binary file having the information encoded as: 2 bytes of key1, 2 bytes of value_len1, ‘value_len1’ bytes of ‘value1’, 2 bytes of key2, 2 bytes of value_len2, ‘value_len2’ bytes of ‘value2’, 2 bytes of key1, 2 bytes of value_len3, ‘value_len3’ bytes of ‘value3’, 2 bytes of key2, 2 bytes of value_len4, ‘value_len4’ bytes of ‘value4’. The POSIX binary file is simply a sequence of bytes and allows for duplicate keys. This is converted to json format above with values transformed as: base64_encoded_string1_1 = base64_encode(value1[0:value_len1]) base64_encoded_string1_2 = base64_encode(value2[0:value_len2]) base64_encoded_string2_1 = base64_encode(value3[0:value_len3]) base64_encoded_string2_2 = base64_encode(value4[0:value_len4]) Keys are simply decimal representation of uint16_t keys in double quotes.
Settings are guaranteed to have been persisted upon successful completion of this call. The channel will be closed if importing settings fail.
Trait Implementations§
Source§impl Clone for ThreadProxy
impl Clone for ThreadProxy
Source§fn clone(&self) -> ThreadProxy
fn clone(&self) -> ThreadProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ThreadProxy
impl Debug for ThreadProxy
Source§impl Proxy for ThreadProxy
impl Proxy for ThreadProxy
Source§type Protocol = ThreadMarker
type Protocol = ThreadMarker
Proxy
controls.Source§fn from_channel(inner: AsyncChannel) -> Self
fn from_channel(inner: AsyncChannel) -> Self
Source§fn into_channel(self) -> Result<AsyncChannel, Self>
fn into_channel(self) -> Result<AsyncChannel, Self>
Source§fn as_channel(&self) -> &AsyncChannel
fn as_channel(&self) -> &AsyncChannel
§fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
Source§impl ThreadProxyInterface for ThreadProxy
impl ThreadProxyInterface for ThreadProxy
type ImportSettingsResponseFut = QueryResponseFut<()>
fn import_settings( &self, thread_settings_json: Buffer, ) -> Self::ImportSettingsResponseFut
Auto Trait Implementations§
impl Freeze for ThreadProxy
impl !RefUnwindSafe for ThreadProxy
impl Send for ThreadProxy
impl Sync for ThreadProxy
impl Unpin for ThreadProxy
impl !UnwindSafe for ThreadProxy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)