-
Notifications
You must be signed in to change notification settings - Fork 6
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 lazy, cheaply guarded proxy-conversions. #202
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #202 +/- ##
==========================================
- Coverage 83.87% 82.14% -1.73%
==========================================
Files 43 44 +1
Lines 3231 3299 +68
==========================================
Hits 2710 2710
- Misses 521 589 +68 ☔ View full report in Codecov by Sentry. |
efbff96
to
5fb3c28
Compare
Rebased |
atspi-proxies/src/related_proxies.rs
Outdated
/// | ||
/// Proxies are lazily initialized, so they are only created when requested. | ||
/// Interface availability is checked before creating the proxy and is a cheap bitop. | ||
pub trait ObjectProxies<'a> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd appreciate something like ProxyExt
or something like that. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't naming supposed to be the hardest thing in software engineering?
ProxyExt
sounds just fine.
atspi-proxies/src/related_proxies.rs
Outdated
} | ||
} | ||
|
||
impl<'a> Proxies<'a> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation is good.
@luukvanderduim are you okay with merging this? |
This introduces lazy and cheaply guarded proxy-conversions.
It adds
ObjectProxies
which extends `AccessibleProxyWe have an easy conversion from
ObjectRef
toAccessibleProxy
AccessibleProxy::get_interfaces
gives insight into which interfaces are unokenebted by the object.ObjectProxies::proxies
returnsProxies
, a struct that can contain zero or more proxies to the objects supported interfaces.The proxies are created only when needed and the check against the
InterfaceSet
is a cheap bitwise operation.