Skip to content

question on generic property type #991

Closed Answered by zeenix
jbbjarnason asked this question in Q&A
Discussion options

You must be logged in to vote

As the error message suggests and documented in the book, property methods require their return value to be transformable to zvariant::Value. I've never seen generics use with properties before so I can't guarantee it will work out of the box, but you need to add Value<'static>: From<T> constraint or something like that (or TryFrom<T>, I can't remember).

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@zeenix
Comment options

@zeenix
Comment options

@jbbjarnason
Comment options

@jbbjarnason
Comment options

@jbbjarnason
Comment options

Answer selected by zeenix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants