Implement assignment operators for Ready
Several operators (|, ^, &, -) are implemented for mio::Ready.
In addition, implement the corresponding assignment versions (|=, ^=, &=,
=).
@@ -824,6 +824,13 @@ impl<T: Into<Ready>> ops::BitOr<T> for Ready {
}
}
+impl<T: Into<Ready>> ops::BitOrAssign<T> for Ready {
+ #[inline]
+ fn bitor_assign(&mut self, other: T) {
+ self.0 |= other.into().0;
+ }
+}
+
impl<T: Into<Ready>> ops::BitXor<T> for Ready {
type Output = Ready;
@@ -833,6 +840,13 @@ impl<T: Into<Ready>> ops::BitXor<T> for Ready {
}
}
+impl<T: Into<Ready>> ops::BitXorAssign<T> for Ready {
+ #[inline]
+ fn bitxor_assign(&mut self, other: T) {
+ self.0 ^= other.into().0;
+ }
+}
+
impl<T: Into<Ready>> ops::BitAnd<T> for Ready {
type Output = Ready;
@@ -842,6 +856,13 @@ impl<T: Into<Ready>> ops::BitAnd<T> for Ready {
}
}
+impl<T: Into<Ready>> ops::BitAndAssign<T> for Ready {
+ #[inline]
+ fn bitand_assign(&mut self, other: T) {
+ self.0 &= other.into().0
+ }
+}
+
impl<T: Into<Ready>> ops::Sub<T> for Ready {
type Output = Ready;
@@ -851,6 +872,13 @@ impl<T: Into<Ready>> ops::Sub<T> for Ready {
}
}
+impl<T: Into<Ready>> ops::SubAssign<T> for Ready {
+ #[inline]
+ fn sub_assign(&mut self, other: T) {
+ self.0 &= !other.into().0;
+ }
+}
+
impl ops::Not for Ready {
type Output = Ready;
