Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple characteristics return #1

Open
druppy opened this issue Feb 13, 2025 · 1 comment
Open

multiple characteristics return #1

druppy opened this issue Feb 13, 2025 · 1 comment

Comments

@druppy
Copy link

druppy commented Feb 13, 2025

Thanks for sharing this, I really liked to try out your work, and sorry in advance if this is a silly question.

In your example you just have a single service and a single characteristic, and you use default to get an instance of the characteristic.

But I tried to return multiple characteristics and that fails when using the example:

impl TestService {
    fn get_characteristics(&self) -> Vec<impl CharacteristicRegister> {
        vec![
            ACharacteristic::default(),
            BCharacteristic::default(), // <-- this fails, as it is not the same type as above 

It could be me that is not the most well trained Rust guy, but how would I make a vector of more than one. Boxed may be a help here, but that is not the same as the Vec<impl ....

@benarmstrongg
Copy link
Owner

Hey thanks for submitting an issue! I’m on vacation right now but will definitely take a look at your issue when I’m back at my desk on Sunday. If you happen to find a fix in the meantime feel free to open a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants