Hi,
I have a service which exposes some properties. When I tried to add another one of type Vec<PathBuf>, it fails to compile
error[E0277]: the trait bound `Vec<PathBuf>: TryFrom<OwnedValue>` is not satisfied
--> src/lib.rs:34:31
|
34 | fn property_one(&self) -> zbus::fdo::Result<Vec<PathBuf>>;
| ^^^^ the trait `TryFrom<OwnedValue>` is not implemented for `Vec<PathBuf>`
I read #977 but FilePath doesn't help here. I hacked together impl From<PathBuf> for OwnedValue and impl<'v> From<PathBuf> for Value<'v> to send OsStrExt::as_bytes - and it worked.
I do understand the requirement for OwnedValue and the lossy PathBuf -> String -> PathBuf cycle, but what's the alternative - use a newtype and manually implement the required traits?
Hi,
I have a service which exposes some properties. When I tried to add another one of type
Vec<PathBuf>, it fails to compileI read #977 but
FilePathdoesn't help here. I hacked togetherimpl From<PathBuf> for OwnedValueandimpl<'v> From<PathBuf> for Value<'v>to sendOsStrExt::as_bytes- and it worked.I do understand the requirement for
OwnedValueand the lossyPathBuf->String->PathBufcycle, but what's the alternative - use a newtype and manually implement the required traits?