MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / new

Method new

rate_limiter/src/group.rs:58–62  ·  view source on GitHub ↗
(inner: Arc<RateLimiterGroupInner>)

Source from the content-addressed store, hash-verified

56
57impl RateLimiterGroupHandle {
58 fn new(inner: Arc<RateLimiterGroupInner>) -> result::Result<Self, Error> {
59 let eventfd = Arc::new(EventFd::new(0).map_err(Error::EventFd)?);
60 inner.handles.lock().unwrap().push(eventfd.clone());
61 Ok(Self { eventfd, inner })
62 }
63
64 /// Attempts to consume tokens and returns whether that is possible.
65 ///

Callers

nothing calls this directly

Calls 5

newFunction · 0.85
createFunction · 0.85
pushMethod · 0.45
cloneMethod · 0.45
as_raw_fdMethod · 0.45

Tested by

no test coverage detected