pub struct DatabaseProxy { /* private fields */ }Expand description
Proxy to a database with easy abstraction for commands that request devices.
Implementations§
Source§impl DatabaseProxy
impl DatabaseProxy
Sourcepub fn new_from_env() -> Self
pub fn new_from_env() -> Self
New handle to the environment database.
Sourcepub fn new_from_env_with_backend(backend: Arc<dyn Backend>) -> Self
pub fn new_from_env_with_backend(backend: Arc<dyn Backend>) -> Self
New handle to the environment database, with backend.
Sourcepub fn new_with_backend(
backend: Arc<dyn Backend>,
host: &str,
port: u16,
) -> Self
pub fn new_with_backend( backend: Arc<dyn Backend>, host: &str, port: u16, ) -> Self
New handle to specific host/port, with backend.
Sourcepub async fn database_info_async(&self) -> Result<Spectrum<str>>
pub async fn database_info_async(&self) -> Result<Spectrum<str>>
Get the description of the database server and of what it holds, line by line.
Sourcepub fn database_info(&self) -> Result<Spectrum<str>>
pub fn database_info(&self) -> Result<Spectrum<str>>
The blocking form of Self::database_info_async.
Sourcepub async fn add_dev_async(
&self,
name: &str,
class: &str,
server: &str,
) -> Result<()>
pub async fn add_dev_async( &self, name: &str, class: &str, server: &str, ) -> Result<()>
Define a device of the given class in a server, named exe/inst.
Sourcepub fn add_dev(&self, name: &str, class: &str, server: &str) -> Result<()>
pub fn add_dev(&self, name: &str, class: &str, server: &str) -> Result<()>
The blocking form of Self::add_dev_async.
Sourcepub async fn delete_dev_async(&self, name: &str) -> Result<()>
pub async fn delete_dev_async(&self, name: &str) -> Result<()>
Delete a device.
Sourcepub fn delete_dev(&self, name: &str) -> Result<()>
pub fn delete_dev(&self, name: &str) -> Result<()>
The blocking form of Self::delete_dev_async.
Sourcepub async fn add_server_async(
&self,
server: &str,
devs: &[(&str, &str)],
) -> Result<()>
pub async fn add_server_async( &self, server: &str, devs: &[(&str, &str)], ) -> Result<()>
Define a server, named exe/inst, along with its devices, each given with its class,
a device already defined in another server being moved to this one.
Sourcepub fn add_server(&self, server: &str, devs: &[(&str, &str)]) -> Result<()>
pub fn add_server(&self, server: &str, devs: &[(&str, &str)]) -> Result<()>
The blocking form of Self::add_server_async.
Sourcepub async fn delete_server_async(&self, server: &str) -> Result<()>
pub async fn delete_server_async(&self, server: &str) -> Result<()>
Delete a server, named exe/inst, along with every device of it.
Sourcepub fn delete_server(&self, server: &str) -> Result<()>
pub fn delete_server(&self, server: &str) -> Result<()>
The blocking form of Self::delete_server_async.
Sourcepub async fn rename_server_async(
&self,
name: &str,
new_name: &str,
) -> Result<()>
pub async fn rename_server_async( &self, name: &str, new_name: &str, ) -> Result<()>
Rename a server, named exe/inst, its devices following it.
Sourcepub fn rename_server(&self, name: &str, new_name: &str) -> Result<()>
pub fn rename_server(&self, name: &str, new_name: &str) -> Result<()>
The blocking form of Self::rename_server_async.
Sourcepub async fn list_server_dev_async(
&self,
server: &str,
) -> Result<Vec<Named<Scalar<str>>>>
pub async fn list_server_dev_async( &self, server: &str, ) -> Result<Vec<Named<Scalar<str>>>>
List the devices a server, named exe/inst, should run, the class each device is an
instance of being named by that device. This is what a server queries when booting
in order to know which devices to create and export.
Sourcepub fn list_server_dev(&self, server: &str) -> Result<Vec<Named<Scalar<str>>>>
pub fn list_server_dev(&self, server: &str) -> Result<Vec<Named<Scalar<str>>>>
The blocking form of Self::list_server_dev_async.
Sourcepub async fn list_dev_async(&self, filter: &str) -> Result<Spectrum<str>>
pub async fn list_dev_async(&self, filter: &str) -> Result<Spectrum<str>>
List all existing devices, filtering using a filter, using a pattern for matching with domain/family/member pattern, supporting one ‘*’ per member.
Sourcepub fn list_dev(&self, filter: &str) -> Result<Spectrum<str>>
pub fn list_dev(&self, filter: &str) -> Result<Spectrum<str>>
The blocking form of Self::list_dev_async.
Sourcepub async fn list_dev_member_async(&self, filter: &str) -> Result<Spectrum<str>>
pub async fn list_dev_member_async(&self, filter: &str) -> Result<Spectrum<str>>
Same as Self::list_dev but returns only the member part of the
device names (in domain/family/member).
Sourcepub fn list_dev_member(&self, filter: &str) -> Result<Spectrum<str>>
pub fn list_dev_member(&self, filter: &str) -> Result<Spectrum<str>>
The blocking form of Self::list_dev_member_async.
Sourcepub async fn list_dev_family_async(&self, filter: &str) -> Result<Spectrum<str>>
pub async fn list_dev_family_async(&self, filter: &str) -> Result<Spectrum<str>>
Same as Self::list_dev but returns only the family part of the
device names (in domain/family/member).
Sourcepub fn list_dev_family(&self, filter: &str) -> Result<Spectrum<str>>
pub fn list_dev_family(&self, filter: &str) -> Result<Spectrum<str>>
The blocking form of Self::list_dev_family_async.
Sourcepub async fn list_dev_domain_async(&self, filter: &str) -> Result<Spectrum<str>>
pub async fn list_dev_domain_async(&self, filter: &str) -> Result<Spectrum<str>>
Same as Self::list_dev but returns only the domain part of the
device names (in domain/family/member).
Sourcepub fn list_dev_domain(&self, filter: &str) -> Result<Spectrum<str>>
pub fn list_dev_domain(&self, filter: &str) -> Result<Spectrum<str>>
The blocking form of Self::list_dev_domain_async.
Sourcepub async fn export_dev_async(&self, info: ExportDevInfo<'_>) -> Result<()>
pub async fn export_dev_async(&self, info: ExportDevInfo<'_>) -> Result<()>
Mark a device as exported, recording how to reach it.
Sourcepub fn export_dev(&self, info: ExportDevInfo<'_>) -> Result<()>
pub fn export_dev(&self, info: ExportDevInfo<'_>) -> Result<()>
The blocking form of Self::export_dev_async.
Sourcepub async fn unexport_dev_async(&self, dev_name: &str) -> Result<()>
pub async fn unexport_dev_async(&self, dev_name: &str) -> Result<()>
Mark a device as no longer exported.
Sourcepub fn unexport_dev(&self, dev_name: &str) -> Result<()>
pub fn unexport_dev(&self, dev_name: &str) -> Result<()>
The blocking form of Self::unexport_dev_async.
Sourcepub async fn export_server_async(
&self,
infos: &[ExportDevInfo<'_>],
) -> Result<()>
pub async fn export_server_async( &self, infos: &[ExportDevInfo<'_>], ) -> Result<()>
Mark the devices of a server as exported, see Self::export_dev_async.
Sourcepub fn export_server(&self, infos: &[ExportDevInfo<'_>]) -> Result<()>
pub fn export_server(&self, infos: &[ExportDevInfo<'_>]) -> Result<()>
The blocking form of Self::export_server_async.
Sourcepub async fn unexport_server_async(&self, server: &str) -> Result<()>
pub async fn unexport_server_async(&self, server: &str) -> Result<()>
Mark every device of a server, named exe/inst, as no longer exported.
Sourcepub fn unexport_server(&self, server: &str) -> Result<()>
pub fn unexport_server(&self, server: &str) -> Result<()>
The blocking form of Self::unexport_server_async.
Sourcepub async fn list_exported_dev_async(
&self,
filter: &str,
) -> Result<Spectrum<str>>
pub async fn list_exported_dev_async( &self, filter: &str, ) -> Result<Spectrum<str>>
Same input as Self::list_dev, but returns only devices that should
currently be exported.
Sourcepub fn list_exported_dev(&self, filter: &str) -> Result<Spectrum<str>>
pub fn list_exported_dev(&self, filter: &str) -> Result<Spectrum<str>>
The blocking form of Self::list_exported_dev_async.
Sourcepub async fn import_dev_async(&self, dev_name: &str) -> Result<ImportDevInfo>
pub async fn import_dev_async(&self, dev_name: &str) -> Result<ImportDevInfo>
Get how to reach a device, failing with ErrorKind::DevNotFound if not defined.
Sourcepub fn import_dev(&self, dev_name: &str) -> Result<ImportDevInfo>
pub fn import_dev(&self, dev_name: &str) -> Result<ImportDevInfo>
The blocking form of Self::import_dev_async.
Sourcepub async fn get_dev_info_async(&self, dev_name: &str) -> Result<DbDevInfo>
pub async fn get_dev_info_async(&self, dev_name: &str) -> Result<DbDevInfo>
Get what the database knows of a device, failing with ErrorKind::DevNotFound if
not defined.
Sourcepub fn get_dev_info(&self, dev_name: &str) -> Result<DbDevInfo>
pub fn get_dev_info(&self, dev_name: &str) -> Result<DbDevInfo>
The blocking form of Self::get_dev_info_async.
Sourcepub async fn get_dev_alias_async(
&self,
dev_name: &str,
) -> Result<Option<Scalar<str>>>
pub async fn get_dev_alias_async( &self, dev_name: &str, ) -> Result<Option<Scalar<str>>>
Get alias for a given device.
Sourcepub fn get_dev_alias(&self, dev_name: &str) -> Result<Option<Scalar<str>>>
pub fn get_dev_alias(&self, dev_name: &str) -> Result<Option<Scalar<str>>>
The blocking form of Self::get_dev_alias_async.
Sourcepub async fn resolve_dev_alias_async(&self, alias: &str) -> Result<Scalar<str>>
pub async fn resolve_dev_alias_async(&self, alias: &str) -> Result<Scalar<str>>
Resolve a device alias, failing with ErrorKind::AliasNotFound if not found.
Sourcepub fn resolve_dev_alias(&self, alias: &str) -> Result<Scalar<str>>
pub fn resolve_dev_alias(&self, alias: &str) -> Result<Scalar<str>>
The blocking form of Self::resolve_dev_alias_async.
Sourcepub async fn list_dev_aliases_async(
&self,
filter: &str,
) -> Result<Spectrum<str>>
pub async fn list_dev_aliases_async( &self, filter: &str, ) -> Result<Spectrum<str>>
List all device aliases matching the given filter (using at most one ‘*’).
Sourcepub fn list_dev_aliases(&self, filter: &str) -> Result<Spectrum<str>>
pub fn list_dev_aliases(&self, filter: &str) -> Result<Spectrum<str>>
The blocking form of Self::list_dev_aliases_async.
Sourcepub async fn get_attr_alias_async(
&self,
attr_name: &str,
) -> Result<Option<Scalar<str>>>
pub async fn get_attr_alias_async( &self, attr_name: &str, ) -> Result<Option<Scalar<str>>>
Get alias for a given attribute.
Sourcepub fn get_attr_alias(&self, attr_name: &str) -> Result<Option<Scalar<str>>>
pub fn get_attr_alias(&self, attr_name: &str) -> Result<Option<Scalar<str>>>
The blocking form of Self::get_attr_alias_async.
Sourcepub async fn resolve_attr_alias_async(&self, alias: &str) -> Result<Scalar<str>>
pub async fn resolve_attr_alias_async(&self, alias: &str) -> Result<Scalar<str>>
Resolve an attribute alias, failing with ErrorKind::AliasNotFound if not found.
Sourcepub fn resolve_attr_alias(&self, alias: &str) -> Result<Scalar<str>>
pub fn resolve_attr_alias(&self, alias: &str) -> Result<Scalar<str>>
The blocking form of Self::resolve_attr_alias_async.
Sourcepub async fn list_attr_aliases_async(
&self,
filter: &str,
) -> Result<Spectrum<str>>
pub async fn list_attr_aliases_async( &self, filter: &str, ) -> Result<Spectrum<str>>
List all attribute aliases matching the given filter (using at most one ‘*’).
Sourcepub fn list_attr_aliases(&self, filter: &str) -> Result<Spectrum<str>>
pub fn list_attr_aliases(&self, filter: &str) -> Result<Spectrum<str>>
The blocking form of Self::list_attr_aliases_async.
Sourcepub async fn list_free_prop_async(
&self,
obj_name: &str,
filter: &str,
) -> Result<Spectrum<str>>
pub async fn list_free_prop_async( &self, obj_name: &str, filter: &str, ) -> Result<Spectrum<str>>
List the names of the free properties of an object matching the given filter.
Sourcepub fn list_free_prop(
&self,
obj_name: &str,
filter: &str,
) -> Result<Spectrum<str>>
pub fn list_free_prop( &self, obj_name: &str, filter: &str, ) -> Result<Spectrum<str>>
The blocking form of Self::list_free_prop_async.
Sourcepub async fn list_class_prop_async(
&self,
obj_name: &str,
filter: &str,
) -> Result<Spectrum<str>>
pub async fn list_class_prop_async( &self, obj_name: &str, filter: &str, ) -> Result<Spectrum<str>>
List the names of the properties of a class matching the given filter.
Sourcepub fn list_class_prop(
&self,
obj_name: &str,
filter: &str,
) -> Result<Spectrum<str>>
pub fn list_class_prop( &self, obj_name: &str, filter: &str, ) -> Result<Spectrum<str>>
The blocking form of Self::list_class_prop_async.
Sourcepub async fn list_dev_prop_async(
&self,
obj_name: &str,
filter: &str,
) -> Result<Spectrum<str>>
pub async fn list_dev_prop_async( &self, obj_name: &str, filter: &str, ) -> Result<Spectrum<str>>
List the names of the properties of a device matching the given filter.
Sourcepub fn list_dev_prop(
&self,
obj_name: &str,
filter: &str,
) -> Result<Spectrum<str>>
pub fn list_dev_prop( &self, obj_name: &str, filter: &str, ) -> Result<Spectrum<str>>
The blocking form of Self::list_dev_prop_async.
Sourcepub fn get_free_prop_async<Spec, Names: ToNames>(
&self,
obj_name: &str,
names: Names,
) -> impl Future<Output = Result<Spec::Output>> + Sendwhere
Spec: GetPropSpec<Names>,
pub fn get_free_prop_async<Spec, Names: ToNames>(
&self,
obj_name: &str,
names: Names,
) -> impl Future<Output = Result<Spec::Output>> + Sendwhere
Spec: GetPropSpec<Names>,
The properties of that free object, parsed into the shape the given names ask for,
see Self::get_dev_prop_async for the accepted signatures.
Sourcepub fn get_free_prop<Spec, Names: ToNames>(
&self,
obj_name: &str,
names: Names,
) -> Result<Spec::Output>where
Spec: GetPropSpec<Names>,
pub fn get_free_prop<Spec, Names: ToNames>(
&self,
obj_name: &str,
names: Names,
) -> Result<Spec::Output>where
Spec: GetPropSpec<Names>,
The properties of that free object, see Self::get_free_prop_async.
Sourcepub fn get_class_prop_async<Spec, Names: ToNames>(
&self,
class_name: &str,
names: Names,
) -> impl Future<Output = Result<Spec::Output>> + Sendwhere
Spec: GetPropSpec<Names>,
pub fn get_class_prop_async<Spec, Names: ToNames>(
&self,
class_name: &str,
names: Names,
) -> impl Future<Output = Result<Spec::Output>> + Sendwhere
Spec: GetPropSpec<Names>,
The properties of that class, parsed into the shape the given names ask for, see
Self::get_dev_prop_async for the accepted signatures.
Sourcepub fn get_class_prop<Spec, Names: ToNames>(
&self,
class_name: &str,
names: Names,
) -> Result<Spec::Output>where
Spec: GetPropSpec<Names>,
pub fn get_class_prop<Spec, Names: ToNames>(
&self,
class_name: &str,
names: Names,
) -> Result<Spec::Output>where
Spec: GetPropSpec<Names>,
The properties of that class, see Self::get_class_prop_async.
Sourcepub fn get_dev_prop_async<Spec, Names: ToNames>(
&self,
dev_name: &str,
names: Names,
) -> impl Future<Output = Result<Spec::Output>> + Sendwhere
Spec: GetPropSpec<Names>,
pub fn get_dev_prop_async<Spec, Names: ToNames>(
&self,
dev_name: &str,
names: Names,
) -> impl Future<Output = Result<Spec::Output>> + Sendwhere
Spec: GetPropSpec<Names>,
The properties of that device, parsed into the shape the given names ask for. This specification is really flexible and allows various signatures for the function:
get_dev_prop<T>(&str, &str) -> Result<T>get_dev_prop<T>(&str, &[&str]) -> Result<Vec<Result<T>>>get_dev_prop<T>(&str, [&str; N]) -> Result<[Result<T>; N]>get_dev_prop<(A, B, ...)>(&str, (&str, &str, ...)) -> Result<(Result<A>, Result<B>, ...)>get_dev_prop<Spectrum<str>>(&str, All) -> Result<Vec<Named<Spectrum<str>>>>
Form 2 also takes the names as a Spectrum<str>, owned or borrowed. Every value
is parsed with FromProp: a String, a Vec<String>, a Spectrum<str>
sharing the reply, a bool or a number. Like for DevProxy::read_attr, the
type has to come from a turbofish, as in get_dev_prop::<f64, _>(dev, "speed"),
or from the binding the output is assigned to.
A property the database holds nothing for has no value, which the text forms read
as empty and the others fail with ErrorKind::InvalidProp. Form 5 gives every
property the device has, each with its name, as the raw values it holds.
All the properties are read within a single request. Note that, unlike the many-properties forms, form 1 has no per-property slot in its output and therefore returns that property’s error directly.
Sourcepub fn get_dev_prop<Spec, Names: ToNames>(
&self,
dev_name: &str,
names: Names,
) -> Result<Spec::Output>where
Spec: GetPropSpec<Names>,
pub fn get_dev_prop<Spec, Names: ToNames>(
&self,
dev_name: &str,
names: Names,
) -> Result<Spec::Output>where
Spec: GetPropSpec<Names>,
The properties of that device, see Self::get_dev_prop_async.
Sourcepub fn set_free_prop_async<'a, Spec>(
&self,
obj_name: &'a str,
spec: Spec,
) -> impl Future<Output = Result<()>> + Sendwhere
Spec: SetPropSpec<'a>,
pub fn set_free_prop_async<'a, Spec>(
&self,
obj_name: &'a str,
spec: Spec,
) -> impl Future<Output = Result<()>> + Sendwhere
Spec: SetPropSpec<'a>,
Write the given properties of that free object, see Self::set_dev_prop_async
for the accepted signatures.
Sourcepub fn set_free_prop<'a, Spec>(
&self,
obj_name: &'a str,
spec: Spec,
) -> Result<()>where
Spec: SetPropSpec<'a>,
pub fn set_free_prop<'a, Spec>(
&self,
obj_name: &'a str,
spec: Spec,
) -> Result<()>where
Spec: SetPropSpec<'a>,
Write the given properties of that free object, see Self::set_free_prop_async.
Sourcepub fn set_class_prop_async<'a, Spec>(
&self,
class_name: &'a str,
spec: Spec,
) -> impl Future<Output = Result<()>> + Sendwhere
Spec: SetPropSpec<'a>,
pub fn set_class_prop_async<'a, Spec>(
&self,
class_name: &'a str,
spec: Spec,
) -> impl Future<Output = Result<()>> + Sendwhere
Spec: SetPropSpec<'a>,
Write the given properties of that class, see Self::set_dev_prop_async for the
accepted signatures.
Sourcepub fn set_class_prop<'a, Spec>(
&self,
class_name: &'a str,
spec: Spec,
) -> Result<()>where
Spec: SetPropSpec<'a>,
pub fn set_class_prop<'a, Spec>(
&self,
class_name: &'a str,
spec: Spec,
) -> Result<()>where
Spec: SetPropSpec<'a>,
Write the given properties of that class, see Self::set_class_prop_async.
Sourcepub fn set_dev_prop_async<'a, Spec>(
&self,
dev_name: &'a str,
spec: Spec,
) -> impl Future<Output = Result<()>> + Sendwhere
Spec: SetPropSpec<'a>,
pub fn set_dev_prop_async<'a, Spec>(
&self,
dev_name: &'a str,
spec: Spec,
) -> impl Future<Output = Result<()>> + Sendwhere
Spec: SetPropSpec<'a>,
Write the given properties of that device, given as pairs of a name and a value.
Like for Self::get_dev_prop, this specification is really flexible and allows
various signatures for the function:
set_dev_prop(&str, (&str, T)) -> Result<()>set_dev_prop(&str, [(&str, T); N]) -> Result<()>set_dev_prop(&str, Vec<(&str, T)>) -> Result<()>set_dev_prop(&str, ((&str, A), (&str, B), ...)) -> Result<()>
Each value only needs to implement IntoProp, a bool, a number or a string,
so the value types are inferred from the specification and never have to be named,
form 4 giving each property its own type, as in
set_dev_prop(dev, (("speed", 2.5), ("unit", "mm"))).
All the properties are written within a single request, a property that was already there being overwritten.
Sourcepub fn set_dev_prop<'a, Spec>(
&self,
dev_name: &'a str,
spec: Spec,
) -> Result<()>where
Spec: SetPropSpec<'a>,
pub fn set_dev_prop<'a, Spec>(
&self,
dev_name: &'a str,
spec: Spec,
) -> Result<()>where
Spec: SetPropSpec<'a>,
Write the given properties of that device, see Self::set_dev_prop_async.
Sourcepub fn delete_free_prop_async<Names: ToNamesNotAll>(
&self,
obj_name: &str,
names: Names,
) -> impl Future<Output = Result<()>> + Send
pub fn delete_free_prop_async<Names: ToNamesNotAll>( &self, obj_name: &str, names: Names, ) -> impl Future<Output = Result<()>> + Send
Delete the given properties of that free object, see Self::delete_dev_prop_async
for the accepted signatures.
Sourcepub fn delete_free_prop<Names: ToNamesNotAll>(
&self,
obj_name: &str,
names: Names,
) -> Result<()>
pub fn delete_free_prop<Names: ToNamesNotAll>( &self, obj_name: &str, names: Names, ) -> Result<()>
Delete the given properties of that free object, see Self::delete_free_prop_async.
Sourcepub fn delete_class_prop_async<Names: ToNamesNotAll>(
&self,
class_name: &str,
names: Names,
) -> impl Future<Output = Result<()>> + Send
pub fn delete_class_prop_async<Names: ToNamesNotAll>( &self, class_name: &str, names: Names, ) -> impl Future<Output = Result<()>> + Send
Delete the given properties of that class, see Self::delete_dev_prop_async for the
accepted signatures.
Sourcepub fn delete_class_prop<Names: ToNamesNotAll>(
&self,
class_name: &str,
names: Names,
) -> Result<()>
pub fn delete_class_prop<Names: ToNamesNotAll>( &self, class_name: &str, names: Names, ) -> Result<()>
Delete the given properties of that class, see Self::delete_class_prop_async.
Sourcepub fn delete_dev_prop_async<Names: ToNamesNotAll>(
&self,
dev_name: &str,
names: Names,
) -> impl Future<Output = Result<()>> + Send
pub fn delete_dev_prop_async<Names: ToNamesNotAll>( &self, dev_name: &str, names: Names, ) -> impl Future<Output = Result<()>> + Send
Delete the given properties of that device, which allows various signatures for the function:
delete_dev_prop(&str, &str) -> Result<()>delete_dev_prop(&str, &[&str]) -> Result<()>delete_dev_prop(&str, [&str; N]) -> Result<()>delete_dev_prop(&str, (&str, &str, ...)) -> Result<()>
Form 2 also takes the names as a Spectrum<str>, owned or borrowed. Every name
has to be given, All not being accepted, and deleting a property the database
holds nothing for is not an error.
Sourcepub fn delete_dev_prop<Names: ToNamesNotAll>(
&self,
dev_name: &str,
names: Names,
) -> Result<()>
pub fn delete_dev_prop<Names: ToNamesNotAll>( &self, dev_name: &str, names: Names, ) -> Result<()>
Delete the given properties of that device, see Self::delete_dev_prop_async.
Sourcepub fn get_class_attr_prop_async<Spec, AttrNames, Names>(
&self,
class_name: &str,
attr_names: AttrNames,
prop_names: Names,
) -> impl Future<Output = Result<Spec::Output>> + Send
pub fn get_class_attr_prop_async<Spec, AttrNames, Names>( &self, class_name: &str, attr_names: AttrNames, prop_names: Names, ) -> impl Future<Output = Result<Spec::Output>> + Send
The properties of the given attributes of that class, parsed into the shape the names
of the attributes and of the properties ask for, see Self::get_dev_attr_prop_async
for the accepted signatures.
Sourcepub fn get_class_attr_prop<Spec, AttrNames, Names>(
&self,
class_name: &str,
attr_names: AttrNames,
prop_names: Names,
) -> Result<Spec::Output>
pub fn get_class_attr_prop<Spec, AttrNames, Names>( &self, class_name: &str, attr_names: AttrNames, prop_names: Names, ) -> Result<Spec::Output>
The properties of the given attributes of that class, see
Self::get_class_attr_prop_async.
Sourcepub fn get_dev_attr_prop_async<Spec, AttrNames, Names>(
&self,
dev_name: &str,
attr_names: AttrNames,
prop_names: Names,
) -> impl Future<Output = Result<Spec::Output>> + Send
pub fn get_dev_attr_prop_async<Spec, AttrNames, Names>( &self, dev_name: &str, attr_names: AttrNames, prop_names: Names, ) -> impl Future<Output = Result<Spec::Output>> + Send
The properties of the given attributes of that device, or of every attribute of it
that has any, parsed into the shape the names of the attributes and of the properties
ask for. The names of the properties are given the way they are to
Self::get_dev_prop, and give the same output for every attribute, written P
below, which the names of the attributes then shape in the same way:
get_dev_attr_prop<T>(&str, &str, Names) -> Result<P>get_dev_attr_prop<T>(&str, &[&str], Names) -> Result<Vec<Result<P>>>get_dev_attr_prop<T>(&str, [&str; N], Names) -> Result<[Result<P>; N]>get_dev_attr_prop<T>(&str, (&str, &str, ...), Names) -> Result<(Result<P>, Result<P>, ...)>get_dev_attr_prop<T>(&str, All, Names) -> Result<Vec<NamedResult<P>>>
Form 2 also takes the names as a Spectrum<str>, owned or borrowed, and form 5
gives every attribute the device holds any property for, each with its name. For
instance:
get_dev_attr_prop::<String, _, _>(dev, "Position", "unit") -> Result<String>get_dev_attr_prop::<String, _, _>(dev, ["Position", "Speed"], "unit") -> Result<[Result<String>; 2]>get_dev_attr_prop::<(String, f64), _, _>(dev, "Position", ("label", "__value")) -> Result<(Result<String>, Result<f64>)>get_dev_attr_prop::<Spectrum<str>, _, _>(dev, All, All) -> Result<Vec<NamedResult<Vec<Named<Spectrum<str>>>>>>
All the attributes are read within a single request. Note that form 1 has no per-attribute slot in its output and therefore returns that attribute’s error directly, the same way form 1 of the properties does.
Sourcepub fn get_dev_attr_prop<Spec, AttrNames, Names>(
&self,
dev_name: &str,
attr_names: AttrNames,
prop_names: Names,
) -> Result<Spec::Output>
pub fn get_dev_attr_prop<Spec, AttrNames, Names>( &self, dev_name: &str, attr_names: AttrNames, prop_names: Names, ) -> Result<Spec::Output>
The properties of the given attributes of that device, see
Self::get_dev_attr_prop_async.
Sourcepub fn set_class_attr_prop_async<'a, Spec>(
&self,
class_name: &'a str,
spec: Spec,
) -> impl Future<Output = Result<()>> + Sendwhere
Spec: SetAttrPropSpec<'a>,
pub fn set_class_attr_prop_async<'a, Spec>(
&self,
class_name: &'a str,
spec: Spec,
) -> impl Future<Output = Result<()>> + Sendwhere
Spec: SetAttrPropSpec<'a>,
Write the given properties of attributes of that class, see
Self::set_dev_attr_prop_async for the accepted signatures.
Sourcepub fn set_class_attr_prop<'a, Spec>(
&self,
class_name: &'a str,
spec: Spec,
) -> Result<()>where
Spec: SetAttrPropSpec<'a>,
pub fn set_class_attr_prop<'a, Spec>(
&self,
class_name: &'a str,
spec: Spec,
) -> Result<()>where
Spec: SetAttrPropSpec<'a>,
Write the given properties of attributes of that class, see
Self::set_class_attr_prop_async.
Sourcepub fn set_dev_attr_prop_async<'a, Spec>(
&self,
dev_name: &'a str,
spec: Spec,
) -> impl Future<Output = Result<()>> + Sendwhere
Spec: SetAttrPropSpec<'a>,
pub fn set_dev_attr_prop_async<'a, Spec>(
&self,
dev_name: &'a str,
spec: Spec,
) -> impl Future<Output = Result<()>> + Sendwhere
Spec: SetAttrPropSpec<'a>,
Write the given properties of attributes of that device, each attribute given as a
pair of its name and of its properties, the latter in any of the forms
Self::set_dev_prop accepts, written S below:
set_dev_attr_prop(&str, (&str, S)) -> Result<()>set_dev_attr_prop(&str, [(&str, S); N]) -> Result<()>set_dev_attr_prop(&str, Vec<(&str, S)>) -> Result<()>
Forms 2 and 3 give every attribute the same form of properties. For instance:
set_dev_attr_prop(dev, ("Position", ("unit", "mm")))set_dev_attr_prop(dev, ("Position", (("unit", "mm"), ("min_value", -5))))set_dev_attr_prop(dev, [("Position", vec![("label", "Pos")]), ("Speed", vec![("rel_change", "1")])])
All the attributes are written within a single request.
Sourcepub fn set_dev_attr_prop<'a, Spec>(
&self,
dev_name: &'a str,
spec: Spec,
) -> Result<()>where
Spec: SetAttrPropSpec<'a>,
pub fn set_dev_attr_prop<'a, Spec>(
&self,
dev_name: &'a str,
spec: Spec,
) -> Result<()>where
Spec: SetAttrPropSpec<'a>,
Write the given properties of attributes of that device, see
Self::set_dev_attr_prop_async.
Sourcepub fn delete_class_attr_prop_async<Names: ToNamesNotAll>(
&self,
class_name: &str,
attr_name: &str,
names: Names,
) -> impl Future<Output = Result<()>> + Send
pub fn delete_class_attr_prop_async<Names: ToNamesNotAll>( &self, class_name: &str, attr_name: &str, names: Names, ) -> impl Future<Output = Result<()>> + Send
Delete the given properties of one attribute of that class, see
Self::delete_dev_attr_prop_async for the accepted signatures.
Sourcepub fn delete_class_attr_prop<Names: ToNamesNotAll>(
&self,
class_name: &str,
attr_name: &str,
names: Names,
) -> Result<()>
pub fn delete_class_attr_prop<Names: ToNamesNotAll>( &self, class_name: &str, attr_name: &str, names: Names, ) -> Result<()>
Delete the given properties of one attribute of that class, see
Self::delete_class_attr_prop_async.
Sourcepub fn delete_dev_attr_prop_async<Names: ToNamesNotAll>(
&self,
dev_name: &str,
attr_name: &str,
names: Names,
) -> impl Future<Output = Result<()>> + Send
pub fn delete_dev_attr_prop_async<Names: ToNamesNotAll>( &self, dev_name: &str, attr_name: &str, names: Names, ) -> impl Future<Output = Result<()>> + Send
Delete the given properties of one attribute of that device, the names of the
properties being given the way they are to Self::delete_dev_prop:
delete_dev_attr_prop(&str, &str, &str) -> Result<()>delete_dev_attr_prop(&str, &str, &[&str]) -> Result<()>delete_dev_attr_prop(&str, &str, [&str; N]) -> Result<()>delete_dev_attr_prop(&str, &str, (&str, &str, ...)) -> Result<()>
Only one attribute is deleted from per request, the database having no command deleting from several at once.
Sourcepub fn delete_dev_attr_prop<Names: ToNamesNotAll>(
&self,
dev_name: &str,
attr_name: &str,
names: Names,
) -> Result<()>
pub fn delete_dev_attr_prop<Names: ToNamesNotAll>( &self, dev_name: &str, attr_name: &str, names: Names, ) -> Result<()>
Delete the given properties of one attribute of that device, see
Self::delete_dev_attr_prop_async.
Methods from Deref<Target = DevProxy>§
pub fn backend(&self) -> &Arc<dyn Backend> ⓘ
Sourcepub fn timeout(&self) -> Duration
pub fn timeout(&self) -> Duration
Retrieve the timeout duration currently used for all requests.
Sourcepub fn set_timeout(&mut self, timeout: Duration) -> Duration
pub fn set_timeout(&mut self, timeout: Duration) -> Duration
Set the timeout duration and return the previous one. See Self::timeout.
Sourcepub fn source(&self) -> DevSource
pub fn source(&self) -> DevSource
Retrieve the source of data currently used for attribute readings and commands.
Sourcepub fn set_source(&mut self, source: DevSource) -> DevSource
pub fn set_source(&mut self, source: DevSource) -> DevSource
Set the source of data and return the previous one. See Self::source.
Sourcepub fn database(&self) -> Result<&DatabaseProxy>
pub fn database(&self) -> Result<&DatabaseProxy>
Return the DatabaseProxy this device has been requested from, or this device as a
database if it is one. A device reached without a database fails with
ErrorKind::DatabaseNeeded.
Sourcepub fn connect(&self) -> Result<()>
pub fn connect(&self) -> Result<()>
Connect this proxy to its device if that has not happened yet, so that its clones share that connection instead of each making its own.
Sourcepub async fn connect_async(&self) -> Result<()>
pub async fn connect_async(&self) -> Result<()>
Connect this proxy to its device if that has not happened yet, see Self::connect.
Sourcepub async fn name_async(&self) -> Result<Arc<str>>
pub async fn name_async(&self) -> Result<Arc<str>>
Resolve this device’s name, see Self::name.
Sourcepub fn admin_dev_name(&self) -> Result<Arc<str>>
pub fn admin_dev_name(&self) -> Result<Arc<str>>
Resolve this device’s admin device name.
Sourcepub async fn admin_dev_name_async(&self) -> Result<Arc<str>>
pub async fn admin_dev_name_async(&self) -> Result<Arc<str>>
Resolve this device’s admin device name, see Self::admin_dev_name.
Sourcepub async fn admin_dev_async(&self) -> Result<DevProxy>
pub async fn admin_dev_async(&self) -> Result<DevProxy>
Resolve this device’s admin device and return it, see Self::admin_dev.
Sourcepub fn info(&self) -> Result<DevInfo>
pub fn info(&self) -> Result<DevInfo>
Get what the device says it is: the class it is an instance of, the server running it and where, and the versions of whatever that server is built out of.
All of it is the server’s own description of itself and none of it is asked of the database, so it answers for a device served without one.
Sourcepub async fn info_async(&self) -> Result<DevInfo>
pub async fn info_async(&self) -> Result<DevInfo>
Get what the device says it is, see Self::info.
Sourcepub async fn ping_async(&self) -> Result<()>
pub async fn ping_async(&self) -> Result<()>
Ping this device, see Self::ping.
Sourcepub async fn state_async(&self) -> Result<DevState>
pub async fn state_async(&self) -> Result<DevState>
Get the device state, see Self::state.
Sourcepub async fn status_async(&self) -> Result<Scalar<str>>
pub async fn status_async(&self) -> Result<Scalar<str>>
Get the device status, see Self::status.
Sourcepub fn init_async(&self) -> impl Future<Output = Result<()>> + Send
pub fn init_async(&self) -> impl Future<Output = Result<()>> + Send
Initialize the device again, see Self::init.
Sourcepub fn black_box(&self, max: Option<usize>) -> Result<Spectrum<str>>
pub fn black_box(&self, max: Option<usize>) -> Result<Spectrum<str>>
Request the device black box.
Sourcepub async fn black_box_async(&self, max: Option<usize>) -> Result<Spectrum<str>>
pub async fn black_box_async(&self, max: Option<usize>) -> Result<Spectrum<str>>
Request the device black box, see Self::black_box.
Sourcepub fn command_async<I, O>(
&self,
name: &str,
input: I,
) -> impl Future<Output = Result<O>> + Send
pub fn command_async<I, O>( &self, name: &str, input: I, ) -> impl Future<Output = Result<O>> + Send
Execute a remote command, giving back what it answered with, converted into the type
it is expected to be, see FromValue.
The value shares the octets the device answered with, so asking for a Value or
for one of the buffers it holds — a crate::value::Spectrum of a million points
above all — copies nothing, where the usual owned types are copied out of it.
Sourcepub fn command<I, O>(&self, name: &str, input: I) -> Result<O>
pub fn command<I, O>(&self, name: &str, input: I) -> Result<O>
Execute a remote command, giving back what it answered with, see
Self::command_async.
Sourcepub fn read_attr_async<Spec, Names: ToNames>(
&self,
names: Names,
) -> impl Future<Output = Result<Spec::Output>> + Sendwhere
Spec: ReadAttrSpec<Names>,
pub fn read_attr_async<Spec, Names: ToNames>(
&self,
names: Names,
) -> impl Future<Output = Result<Spec::Output>> + Sendwhere
Spec: ReadAttrSpec<Names>,
Read attributes given a specification of attributes. This specification is really flexible and allows various signatures for the function:
read_attr<T>(&str) -> Result<AttrRead<T>>read_attr<T>(&[&str]) -> Result<Vec<Result<AttrRead<T>>>>read_attr<T>([&str; N]) -> Result<[Result<AttrRead<T>>; N]>read_attr<(A, B, ...)>((&str, &str, ...)) -> Result<(Result<AttrRead<A>>, Result<AttrRead<B>>, ...)>read_attr<T>(All) -> Result<Vec<NamedResult<AttrRead<T>>>>
Forms 1 to 3 and 5 convert every attribute into the same type, whereas form 4 gives
each attribute its own type. Nothing in the names constrains the specification, so
it has to come either from a turbofish, leaving the names inferred as in
read_attr::<i16, _>("enum_scalar"), or from the type of the binding it is assigned
to. Reading into a Value keeps whatever the device answered with, and reading
into a buffer copies nothing, see Self::command_async.
Each reading comes with the Result of that one reading, so that a per-attribute
failure is seen without the whole request failing. Note that, unlike the
many-attributes forms, the single-attribute form has no per-attribute slot in its
output and therefore returns that attribute’s error directly. The fixed-size forms
3 and 4 additionally fail with ErrorKind::Internal if the device does not answer
with exactly as many readings as were requested.
All requested attributes are read within a single request, which matters beyond saving round trips: if the device enforces serialization, it is held for the whole batch and only released at the end, so the readings are consistent with each other instead of being sampled at instants another client could have written between.
Sourcepub fn read_attr<Spec, Names: ToNames>(
&self,
names: Names,
) -> Result<Spec::Output>where
Spec: ReadAttrSpec<Names>,
pub fn read_attr<Spec, Names: ToNames>(
&self,
names: Names,
) -> Result<Spec::Output>where
Spec: ReadAttrSpec<Names>,
Read attributes, see Self::read_attr_async.
Sourcepub fn write_attr_async<'a, Spec>(
&self,
spec: Spec,
) -> impl Future<Output = Result<Spec::Output>> + Sendwhere
Spec: WriteAttrSpec<'a>,
pub fn write_attr_async<'a, Spec>(
&self,
spec: Spec,
) -> impl Future<Output = Result<Spec::Output>> + Sendwhere
Spec: WriteAttrSpec<'a>,
Write attributes given a specification of attributes and their values, giving back
the outcome of each individual write, in the order they were given. In Tango a write
only carries a value: quality and timestamp cannot be written. Like for
Self::read_attr, this specification is really flexible and allows various
signatures for the function:
write_attr((&str, T)) -> Result<()>write_attr(Vec<(&str, T)>) -> Result<Vec<Result<()>>>write_attr([(&str, T); N]) -> Result<[Result<()>; N]>write_attr(((&str, A), (&str, B), ...)) -> Result<(Result<()>, Result<()>, ...)>
Each written value only needs to implement IntoValue, so unlike for
Self::read_attr the value types are inferred from the specification and never
have to be named. Note that, unlike the many-attributes forms, the single-attribute
form has no per-attribute slot in its output and therefore returns that attribute’s
error directly. The fixed-size forms 3 and 4 fail with ErrorKind::Internal if
the device does not answer for exactly as many attributes as were written.
Sourcepub fn write_attr<'a, Spec>(&self, spec: Spec) -> Result<Spec::Output>where
Spec: WriteAttrSpec<'a>,
pub fn write_attr<'a, Spec>(&self, spec: Spec) -> Result<Spec::Output>where
Spec: WriteAttrSpec<'a>,
Write attributes, see Self::write_attr_async.
Sourcepub fn write_read_attr_async<'a, Spec>(
&self,
spec: Spec,
) -> impl Future<Output = Result<<Spec::ReadSpec as ReadAttrSpec<Spec::ReadNames>>::Output>> + Send
pub fn write_read_attr_async<'a, Spec>( &self, spec: Spec, ) -> impl Future<Output = Result<<Spec::ReadSpec as ReadAttrSpec<Spec::ReadNames>>::Output>> + Send
Write attributes and read them back, given the same flexible specification as
Self::write_attr, but returning the read-back values instead of unit results.
Each value is converted back into the very type that was written:
write_read_attr((&str, T)) -> Result<AttrRead<T>>write_read_attr(Vec<(&str, T)>) -> Result<Vec<Result<AttrRead<T>>>>write_read_attr([(&str, T); N]) -> Result<[Result<AttrRead<T>>; N]>write_read_attr(((&str, A), (&str, B), ...)) -> Result<(Result<AttrRead<A>>, Result<AttrRead<B>>, ...)>
The read is done by the server right after the write, so this saves a round trip
compared to a Self::write_attr followed by a Self::read_attr, and no other
request can interleave between the two when the device enforces serialization.
Because the read-back is converted back into the written type, each value type must
also implement FromValue here, whereas Self::write_attr only requires
IntoValue.
Sourcepub fn write_read_attr<'a, Spec>(
&self,
spec: Spec,
) -> Result<<Spec::ReadSpec as ReadAttrSpec<Spec::ReadNames>>::Output>
pub fn write_read_attr<'a, Spec>( &self, spec: Spec, ) -> Result<<Spec::ReadSpec as ReadAttrSpec<Spec::ReadNames>>::Output>
Write attributes and read them back, see Self::write_read_attr_async.
Sourcepub fn command_info_async<Spec: ToNamesSpec<CommandInfo>>(
&self,
spec: Spec,
) -> impl Future<Output = Result<Spec::Output>> + Send
pub fn command_info_async<Spec: ToNamesSpec<CommandInfo>>( &self, spec: Spec, ) -> impl Future<Output = Result<Spec::Output>> + Send
Get the static information of commands, given the same flexible specification of
names as Self::read_attr takes:
command_info(&str) -> Result<CommandInfo>command_info(&[&str]) -> Result<Vec<Result<CommandInfo>>>command_info([&str; N]) -> Result<[Result<CommandInfo>; N]>command_info(All) -> Result<Vec<NamedResult<CommandInfo>>>
Every command comes with the Result of that one command, an unknown command name
and a data type that no CommandDataKind has a variant for being the two the
device answers with.
Note that, unlike the attributes, the Tango interface has no operation taking a list
of command names, so asking for several of them costs one request each, where All
only costs one for the whole listing.
Sourcepub fn command_info<Spec: ToNamesSpec<CommandInfo>>(
&self,
spec: Spec,
) -> Result<Spec::Output>
pub fn command_info<Spec: ToNamesSpec<CommandInfo>>( &self, spec: Spec, ) -> Result<Spec::Output>
Get the static information of commands, see Self::command_info_async.
Sourcepub fn attr_info_async<Spec: ToNamesSpec<AttrInfo>>(
&self,
spec: Spec,
) -> impl Future<Output = Result<Spec::Output>> + Send
pub fn attr_info_async<Spec: ToNamesSpec<AttrInfo>>( &self, spec: Spec, ) -> impl Future<Output = Result<Spec::Output>> + Send
Get the static information of attributes, their runtime-modifiable configuration
included, given the same flexible specification of names as Self::read_attr
takes:
attr_info(&str) -> Result<AttrInfo>attr_info(&[&str]) -> Result<Vec<Result<AttrInfo>>>attr_info([&str; N]) -> Result<[Result<AttrInfo>; N]>attr_info(All) -> Result<Vec<NamedResult<AttrInfo>>>
Every attribute comes with the Result of that one attribute, a data type that no
AttrDataKind has a variant for being what the device answers with. Unlike the
commands, an unknown attribute name may fail the whole request, all of them travelling
in a single one, depending on the backend.
Sourcepub fn attr_info<Spec: ToNamesSpec<AttrInfo>>(
&self,
spec: Spec,
) -> Result<Spec::Output>
pub fn attr_info<Spec: ToNamesSpec<AttrInfo>>( &self, spec: Spec, ) -> Result<Spec::Output>
Get the static information of attributes, see Self::attr_info_async.
Sourcepub async fn set_attr_config_async(
&self,
values: &[(&str, AttrConfig)],
) -> Result<Vec<Result<()>>>
pub async fn set_attr_config_async( &self, values: &[(&str, AttrConfig)], ) -> Result<Vec<Result<()>>>
Change the configuration of the given attributes, giving back the outcome of each individual change, in the order they were given.
Only the configuration is writable, which is the part of an AttrInfo that a
client is allowed to set: what an attribute is — its mode, its data kind and its
format — is what its definition says and is never written from the outside.
The whole configuration of an attribute goes out every time, so changing one
property of it is reading the configuration with Self::attr_info and writing
back what was read with that one property changed, which is what the protocol
carries.
A field with no value brings it back to what the attribute inherits from its class, if anything.
Sourcepub fn set_attr_config(
&self,
values: &[(&str, AttrConfig)],
) -> Result<Vec<Result<()>>>
pub fn set_attr_config( &self, values: &[(&str, AttrConfig)], ) -> Result<Vec<Result<()>>>
Change the configuration of the given attributes, see
Self::set_attr_config_async.
Sourcepub async fn command_history_async<T: FromValue>(
&self,
name: &str,
max: usize,
) -> Result<Vec<RecordedResult<T>>>
pub async fn command_history_async<T: FromValue>( &self, name: &str, max: usize, ) -> Result<Vec<RecordedResult<T>>>
The recorded history of a command, oldest entry first and at most max of them:
what the polling of the device recorded, or the device itself, which may manage the
history of a command it does not poll. Every entry is what the command answered
then, converted into the type it is expected to be, a run that failed carrying the
failure it failed with, see Recorded.
A command nothing was recorded of has no history to give, which is a failure and
not an empty history, see ErrorKind::CommandNotPolled and
ErrorKind::AttrNotPolled.
Sourcepub fn command_history<T: FromValue>(
&self,
name: &str,
max: usize,
) -> Result<Vec<RecordedResult<T>>>
pub fn command_history<T: FromValue>( &self, name: &str, max: usize, ) -> Result<Vec<RecordedResult<T>>>
The recorded history of a command, see Self::command_history_async.
Sourcepub async fn attr_history_async<T: FromValue>(
&self,
name: &str,
max: usize,
) -> Result<Vec<RecordedResult<AttrRead<T>>>>
pub async fn attr_history_async<T: FromValue>( &self, name: &str, max: usize, ) -> Result<Vec<RecordedResult<AttrRead<T>>>>
The recorded history of an attribute, see Self::command_history_async, a reading
carrying the time it was recorded at as its own.
Sourcepub fn attr_history<T: FromValue>(
&self,
name: &str,
max: usize,
) -> Result<Vec<RecordedResult<AttrRead<T>>>>
pub fn attr_history<T: FromValue>( &self, name: &str, max: usize, ) -> Result<Vec<RecordedResult<AttrRead<T>>>>
The recorded history of an attribute, see Self::attr_history_async.
Sourcepub async fn poll_attr_async(&self, name: &str, period: Duration) -> Result<()>
pub async fn poll_attr_async(&self, name: &str, period: Duration) -> Result<()>
Poll that attribute of this device at that period, or at another one if it is
polled already, see the AddObjPolling and UpdObjPollingPeriod commands of the
admin device.
Sourcepub fn poll_attr(&self, name: &str, period: Duration) -> Result<()>
pub fn poll_attr(&self, name: &str, period: Duration) -> Result<()>
Poll that attribute of this device, see Self::poll_attr_async.
Sourcepub async fn poll_command_async(
&self,
name: &str,
period: Duration,
) -> Result<()>
pub async fn poll_command_async( &self, name: &str, period: Duration, ) -> Result<()>
Poll that command of this device, see Self::poll_attr_async: only a command
taking no argument can be polled.
Sourcepub fn poll_command(&self, name: &str, period: Duration) -> Result<()>
pub fn poll_command(&self, name: &str, period: Duration) -> Result<()>
Poll that command of this device, see Self::poll_command_async.
Sourcepub async fn stop_poll_attr_async(&self, name: &str) -> Result<()>
pub async fn stop_poll_attr_async(&self, name: &str) -> Result<()>
Stop polling that attribute of this device, failing if it is not polled, see the
RemObjPolling command of the admin device.
Sourcepub fn stop_poll_attr(&self, name: &str) -> Result<()>
pub fn stop_poll_attr(&self, name: &str) -> Result<()>
Stop polling that attribute of this device, see Self::stop_poll_attr_async.
Sourcepub async fn stop_poll_command_async(&self, name: &str) -> Result<()>
pub async fn stop_poll_command_async(&self, name: &str) -> Result<()>
Stop polling that command of this device, see Self::stop_poll_attr_async.
Sourcepub fn stop_poll_command(&self, name: &str) -> Result<()>
pub fn stop_poll_command(&self, name: &str) -> Result<()>
Stop polling that command of this device, see Self::stop_poll_command_async.
Sourcepub async fn attr_poll_period_async(
&self,
name: &str,
) -> Result<Option<Duration>>
pub async fn attr_poll_period_async( &self, name: &str, ) -> Result<Option<Duration>>
The period that attribute of this device is polled at, absent if it is not polled,
out of its polling status, see Self::polling_status_async.
Sourcepub fn attr_poll_period(&self, name: &str) -> Result<Option<Duration>>
pub fn attr_poll_period(&self, name: &str) -> Result<Option<Duration>>
The period that attribute of this device is polled at, see
Self::attr_poll_period_async.
Sourcepub async fn command_poll_period_async(
&self,
name: &str,
) -> Result<Option<Duration>>
pub async fn command_poll_period_async( &self, name: &str, ) -> Result<Option<Duration>>
The period that command of this device is polled at, see
Self::attr_poll_period_async.
Sourcepub fn command_poll_period(&self, name: &str) -> Result<Option<Duration>>
pub fn command_poll_period(&self, name: &str) -> Result<Option<Duration>>
The period that command of this device is polled at, see
Self::command_poll_period_async.
Sourcepub async fn polling_status_async(&self) -> Result<Vec<String>>
pub async fn polling_status_async(&self) -> Result<Vec<String>>
The polling status of this device, one text per object polled, as its admin device
gives it with its DevPollStatus command, none for a device that is not polled.
Sourcepub fn polling_status(&self) -> Result<Vec<String>>
pub fn polling_status(&self) -> Result<Vec<String>>
The polling status of this device, see Self::polling_status_async.
Sourcepub async fn list_prop_async(&self, filter: &str) -> Result<Spectrum<str>>
pub async fn list_prop_async(&self, filter: &str) -> Result<Spectrum<str>>
The names of the properties of this device that match the given filter.
Sourcepub fn list_prop(&self, filter: &str) -> Result<Spectrum<str>>
pub fn list_prop(&self, filter: &str) -> Result<Spectrum<str>>
The names of the properties of this device, see Self::list_prop_async.
Sourcepub fn get_prop_async<Spec, Names: ToNames>(
&self,
names: Names,
) -> impl Future<Output = Result<Spec::Output>> + Sendwhere
Spec: GetPropSpec<Names>,
pub fn get_prop_async<Spec, Names: ToNames>(
&self,
names: Names,
) -> impl Future<Output = Result<Spec::Output>> + Sendwhere
Spec: GetPropSpec<Names>,
The properties of this device, parsed into the shape the given names ask for. Like
for Self::read_attr, this specification is really flexible and allows various
signatures for the function:
get_prop<T>(&str) -> Result<T>get_prop<T>(&[&str]) -> Result<Vec<Result<T>>>get_prop<T>([&str; N]) -> Result<[Result<T>; N]>get_prop<(A, B, ...)>((&str, &str, ...)) -> Result<(Result<A>, Result<B>, ...)>get_prop<Spectrum<str>>(All) -> Result<Vec<Named<Spectrum<str>>>>
See DatabaseProxy::get_dev_prop_async for what the values may be parsed into
and what a property the database holds nothing for gives.
Sourcepub fn get_prop<Spec, Names: ToNames>(
&self,
names: Names,
) -> Result<Spec::Output>where
Spec: GetPropSpec<Names>,
pub fn get_prop<Spec, Names: ToNames>(
&self,
names: Names,
) -> Result<Spec::Output>where
Spec: GetPropSpec<Names>,
The properties of this device, see Self::get_prop_async.
Sourcepub fn set_prop_async<'a, Spec>(
&self,
spec: Spec,
) -> impl Future<Output = Result<()>> + Sendwhere
Spec: SetPropSpec<'a>,
pub fn set_prop_async<'a, Spec>(
&self,
spec: Spec,
) -> impl Future<Output = Result<()>> + Sendwhere
Spec: SetPropSpec<'a>,
Write the given properties of this device, given as pairs of a name and a value, which allows various signatures for the function:
set_prop((&str, T)) -> Result<()>set_prop([(&str, T); N]) -> Result<()>set_prop(Vec<(&str, T)>) -> Result<()>set_prop(((&str, A), (&str, B), ...)) -> Result<()>
See DatabaseProxy::set_dev_prop_async for what the values may be.
Sourcepub fn set_prop<'a, Spec>(&self, spec: Spec) -> Result<()>where
Spec: SetPropSpec<'a>,
pub fn set_prop<'a, Spec>(&self, spec: Spec) -> Result<()>where
Spec: SetPropSpec<'a>,
Write the given properties of this device, see Self::set_prop_async.
Sourcepub fn delete_prop_async<Names: ToNamesNotAll>(
&self,
names: Names,
) -> impl Future<Output = Result<()>> + Send
pub fn delete_prop_async<Names: ToNamesNotAll>( &self, names: Names, ) -> impl Future<Output = Result<()>> + Send
Delete the given properties of this device, which allows various signatures for the function:
delete_prop(&str) -> Result<()>delete_prop(&[&str]) -> Result<()>delete_prop([&str; N]) -> Result<()>delete_prop((&str, &str, ...)) -> Result<()>
Sourcepub fn delete_prop<Names: ToNamesNotAll>(&self, names: Names) -> Result<()>
pub fn delete_prop<Names: ToNamesNotAll>(&self, names: Names) -> Result<()>
Delete the given properties of this device, see Self::delete_prop_async.
Sourcepub fn subscribe_attr_value<T: FromValue>(
&self,
name: &str,
event: AttrValueEvent,
) -> DevChannel<AttrRead<T>>
pub fn subscribe_attr_value<T: FromValue>( &self, name: &str, event: AttrValueEvent, ) -> DevChannel<AttrRead<T>>
Subscribe to the readings of an attribute, of one of the kinds a device pushes them
under, the channel giving the latest of them, see DevChannel.
Nothing is subscribed until the channel is polled, or its subscription ensured, see
DevChannel::ensure_subscribed_async. There is no initial value: the first event
is the next one the device pushes, so read the attribute once subscribed to know
where it stands.
Sourcepub fn subscribe_attr_ready(&self, name: &str) -> DevChannel<AttrReady>
pub fn subscribe_attr_ready(&self, name: &str) -> DevChannel<AttrReady>
Subscribe to an attribute being announced as ready to be read, which carries nothing
of the reading: making it is the subscriber’s to do, see AttrReady. See
Self::subscribe_attr_value.
Sourcepub fn subscribe_attr_config(&self, name: &str) -> DevChannel<AttrInfo>
pub fn subscribe_attr_config(&self, name: &str) -> DevChannel<AttrInfo>
Subscribe to the configuration of an attribute changing, every event carrying the
configuration as it stands after the change. See Self::subscribe_attr_value.