unsafe_method

Macro unsafe_method 

Source
macro_rules! unsafe_method {
    ($self:expr, $fn:ident $(, $arg:expr)+ ) => { ... };
    (~~~ $self:expr, $fn:ident, $tuple:ident,
     ( $_first_arg:expr, $($other_arg:expr),+ ),
     $( ( $($accessor_part:tt),+
        )
     ),*
    ) => { ... };
    (~~~ $self:expr, $fn:ident, $tuple:ident,
     ( $_last_or_only_arg:expr ),
     $( ( $($accessor_part:tt),+
        )
     ),*
    ) => { ... };
}
Expand description

Invoke an unsafe method. Like unsafe_fn, but

  • we accept a receiver self
  • we store self in a variable outside of the generated unsafe {...}
  • we do NOT allow $fn to be an expression (which doesn’t work in standard methods calls), but only an identifier.