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

Add 'bus-tree' example #188

Merged
merged 11 commits into from
Jun 18, 2024
Merged

Add 'bus-tree' example #188

merged 11 commits into from
Jun 18, 2024

Conversation

luukvanderduim
Copy link
Collaborator

@luukvanderduim luukvanderduim commented May 26, 2024

Addresses issue #173

  • Adds the 'bus-tree' example

Also try out static_assertions::assert_cfg! to inform users of the appropriate features to use.
This will make rust-analyzer noisy if you don't have these set in your editor.

  • Add [[example]] section in Cargo.toml, which allows us to point out, using the required-features list which features a user needs.

This tries to add .vscode/settings.json to mitigate that but if this is deemed too opinionated, just remove it.
removed, no longer needed.

Prevents rust-analyzer from making noise over missing features using the
static `assert_cfg!` in the bus_tree example.

We may want to use the `static_cfg!` in other examples too.
"futures" because "futures-lite" does not provide `join_all!'.
"static_assertions" to help users use examples.
"display-tree" for tree printing in the 'bus-tree' example.

Also sorted the dev-dependencies.
Adds the 'bus-tree' example.

Addresses issue #173
Copy link

codecov bot commented May 26, 2024

Codecov Report

Attention: Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.

Project coverage is 86.54%. Comparing base (6d5595c) to head (9a1e134).

Files Patch % Lines
atspi-proxies/src/accessible.rs 0.00% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #188      +/-   ##
==========================================
- Coverage   86.69%   86.54%   -0.16%     
==========================================
  Files          39       39              
  Lines        3337     3344       +7     
==========================================
+ Hits         2893     2894       +1     
- Misses        444      450       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Add `[[example]]` binary sections and add required-features lists on them.

Also clean up examples from old ways.
Also removes .vscode to suppress clippy-grunts.
Also remove static-assertions from dev-dependencies in atspi crate.
Sometimes borrowing may be impractical.
This adds the owning conversion.
…_proxy`

The implementation we had tried to avoid cloning, but did so anyway under the
hood.

Better to do so explicitly and simplify the implementations.
Pull in changes I made locally to simplify and extend `ObjectRefExt`.
With the new iterative method the example's MSRV should now be Rust 1.75

As a bonus, this implementation is much faster with common-sized trees.
@TTWNO
Copy link
Member

TTWNO commented Jun 16, 2024

@luukvanderduim is it possible, knowing what we know able Libreoffice Calc (2^31 children-cells), could you please add functionality for modelling "countable but almost infinite children"?

@luukvanderduim
Copy link
Collaborator Author

@luukvanderduim is it possible, knowing what we know able Libreoffice Calc (2^31 children-cells), could you please add functionality for modelling "countable but almost infinite children"?

Yeah.. it comes at the cost of adding a call per child to get the number of children.

A reasonable number:

  • 65536 children (2^16) Children, which is max_descendants in the Object interface.

A legal threshold:

  • 12810241024 (Max Message size) / 48 (Size of an ObjectRef) = 2_708_821 children.

Or without the extra call. This will cover all stalling responses not just for (in practical terms) infinite children.

  • A timeout (eg. 1 sec.)

…example

Synchronize with latest changes on 'main'.
@TTWNO
Copy link
Member

TTWNO commented Jun 17, 2024

65536 children (2^16) Children, which is max_descendants in the Object interface.

This seems good to me.

We know some applications may expose huge child counts, which will
stall the program.

This imposes an upper limit of 2^16 chilren.
If an object says to have more children, the example will skip it.
@luukvanderduim
Copy link
Collaborator Author

Last commit confirmed to make the example resilient against an 'infinite' number of children.

@luukvanderduim luukvanderduim merged commit eaa55b1 into main Jun 18, 2024
11 of 13 checks passed
@luukvanderduim luukvanderduim deleted the tree-example branch June 18, 2024 11:52
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

Successfully merging this pull request may close these issues.

2 participants