lumeohq / onvif-rs

A native Rust ONVIF client library.
MIT License
114 stars 61 forks source link

SubscriptionPolicyType has no fields #123

Open nrbnlulu opened 8 months ago

nrbnlulu commented 8 months ago

Hi thanks for the lib. is there a reason this is an empty struct? https://github.com/lumeohq/onvif-rs/blob/aeedff9d4b96aa88213a7e62da89dfce01e77602/wsdl_rs/event/src/lib.rs#L98

Is it because of the ##any here? https://github.com/lumeohq/onvif-rs/blob/aeedff9d4b96aa88213a7e62da89dfce01e77602/wsdl/event.wsdl.xml#L95

nrbnlulu commented 8 months ago

Would it be possible to use some dynamic type for any fields by default?

SamuelYvon commented 8 months ago

So you'd be looking for a HashMap type of thing that contains all that data?

nrbnlulu commented 8 months ago

Actually I would use something like raw xml elements since we might want to serialze any field(s). With hashmap that would be hard to implement.

DmitrySamoylov commented 8 months ago

Is it because of the ##any here?

As I remember, xs:any is not supported at all in code generator: https://github.com/lumeohq/xsd-parser-rs?tab=readme-ov-file#any-elements-handling

And not very clear, which type would the Rust field be so that yaserde could set it when parsing XML.