We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32df8ea commit b6ec95eCopy full SHA for b6ec95e
swarm/src/toggle.rs
@@ -51,6 +51,16 @@ impl<TBehaviour> Toggle<TBehaviour> {
51
pub fn is_enabled(&self) -> bool {
52
self.inner.is_some()
53
}
54
+
55
+ /// Returns a reference to the inner `NetworkBehaviour`.
56
+ pub fn as_ref(&self) -> Option<&TBehaviour> {
57
+ self.inner.as_ref()
58
+ }
59
60
+ /// Returns a mutable reference to the inner `NetworkBehaviour`.
61
+ pub fn as_mut(&mut self) -> Option<&mut TBehaviour> {
62
+ self.inner.as_mut()
63
64
65
66
impl<TBehaviour> From<Option<TBehaviour>> for Toggle<TBehaviour> {
0 commit comments