pub struct InGroup<T: ?Sized, Group: ?Sized>(/* private fields */);Expand description
Use the tag from another group.
Not all types are tagged within a given group. This modifier allows switching the group locally.
The Group type is the group that should be used to get the tag from T.
§Examples
use ty_tag::{tag, modifiers::InGroup, Reify};
// A custom group.
struct MyGroup;
// Some random type.
struct X;
// We tag the type X in the group MyGroup.
#[tag(remote, group = MyGroup)]
type Tag = X;
// error[E0277]: the trait bound `Fundamental: Tags<X>` is not satisfied
// is_tagged::<X, X>();
// InGroup uses the tag for X in MyGroup.
is_tagged::<InGroup<X, MyGroup>, X>();
// Checks that T reifies to U.
fn is_tagged<T: Reify<Reified = U>, U>() {}Trait Implementations§
Auto Trait Implementations§
impl<T, Group> Freeze for InGroup<T, Group>
impl<T, Group> RefUnwindSafe for InGroup<T, Group>
impl<T, Group> Send for InGroup<T, Group>
impl<T, Group> Sync for InGroup<T, Group>
impl<T, Group> Unpin for InGroup<T, Group>
impl<T, Group> UnwindSafe for InGroup<T, Group>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more