pub struct Reader { /* private fields */ }Expand description
Reads a device through a client with credentials.
Implementations§
Source§impl Reader
impl Reader
Sourcepub async fn read(
&mut self,
reference: &str,
name: &str,
arguments: &[(&str, &str)],
) -> Result<Values, Error>
pub async fn read( &mut self, reference: &str, name: &str, arguments: &[(&str, &str)], ) -> Result<Values, Error>
Calls an action that only reads, and returns its output with secrets hidden.
§Errors
The errors of finding the service and the action, of
generic::check, and of the call.
Sourcepub async fn document(
&mut self,
reference: &str,
name: &str,
output: &str,
) -> Result<Option<String>, Error>
pub async fn document( &mut self, reference: &str, name: &str, output: &str, ) -> Result<Option<String>, Error>
Fetches a document whose path an action without inputs returns, like
the host list at the path X_AVM-DE_GetHostListPath returns in
NewX_AVM-DE_HostListPath. The path holds a session ID, which never
leaves this function. None if the device has no such action, or
answers it with a fault or without a path, like
try_read.
§Errors
The other errors of the call, and the errors of fetching the document.
Sourcepub async fn document_with(
&mut self,
reference: &str,
__arg2: (&str, &[(&str, &str)]),
output: &str,
query: &str,
) -> Result<Option<String>, Error>
pub async fn document_with( &mut self, reference: &str, __arg2: (&str, &[(&str, &str)]), output: &str, query: &str, ) -> Result<Option<String>, Error>
Like document, for an action with inputs, like
GetPhonebook with NewPhonebookID, and with query added to the
query of the path, like max=10. An action can return a full URL,
like the call list on the address of the device; only its path and
query are fetched, from the device of this reader.
§Errors
The errors of document.
Sourcepub async fn try_read(
&mut self,
reference: &str,
name: &str,
arguments: &[(&str, &str)],
) -> Result<Option<Values>, Error>
pub async fn try_read( &mut self, reference: &str, name: &str, arguments: &[(&str, &str)], ) -> Result<Option<Values>, Error>
Sourcepub async fn entries(
&mut self,
reference: &str,
__arg2: (&str, &str),
__arg3: (&str, &str),
max: u32,
) -> Result<Option<(u32, Vec<Values>)>, Error>
pub async fn entries( &mut self, reference: &str, __arg2: (&str, &str), __arg3: (&str, &str), max: u32, ) -> Result<Option<(u32, Vec<Values>)>, Error>
Reads a list the device gives one entry per call: the number of
entries from the output count of the action counter, then the
entries from getter with each index as its input index, up to
max. Stops early at the first index the device has no entry for.
Returns the number the device reported and the entries, or None
like try_read if it has no such list.
§Errors
The other errors of read.
Sourcepub fn description(&self) -> &DeviceDescription
pub fn description(&self) -> &DeviceDescription
The device description.