fn leak(self) -> &'static str { Box::<str>::leak(self.into()) }
}
+#[derive(Deref,DerefMut)]
pub struct Conn {
pub chan: ClientMgmtChannel,
}
-deref_to_field_mut!{Conn, MgmtChannel, chan}
-
impl Conn {
#[throws(AE)]
pub fn prep_access_account(&mut self, ma: &MainOpts,
to_send: UpdateId,
}
+#[derive(Deref)] // no DerefMut
struct UpdateReader {
- wn: UpdateReaderWN,
+ #[deref] wn: UpdateReaderWN,
overflow: Option<io::Cursor<Box<[u8]>>>,
gref: InstanceRef,
keepalives: Wrapping<u32>,
ending_send: Option<io::Cursor<Box<[u8]>>>,
init_confirmation_send: iter::Once<()>,
}
-deref_to_field!{UpdateReader, UpdateReaderWN, wn} // no DerefMut
impl UpdateReaderWN {
#[throws(io::Error)]
/// Record of acess for a player. Newtype prevents mutable access
/// without invalidating old tokens and permissions check.
#[derive(Serialize,Deserialize,Debug)]
+#[derive(Deref)] // No DerefMut, to make sure we save properly etc.
#[serde(transparent)]
pub struct AccessRecord(Arc<dyn PlayerAccessSpec>);
//---------- AccessRecord ----------
-// No DerefMut, to make sure we save properly etc.
-deref_to_field!{AccessRecord, Arc<dyn PlayerAccessSpec>, 0}
-
impl AccessRecord {
pub fn new_unset() -> Self{ Self( Arc::new(PlayerAccessUnset) ) }