use crate::rust::Access;
use crate::{CodeBuffer, Expression};
pub trait WithAccess: Sized {
fn access(&self) -> &Access;
fn set_access<A>(&mut self, access: A)
where
A: Into<Access>;
#[must_use]
fn with_access<A>(mut self, access: A) -> Self
where
A: Into<Access>,
{
self.set_access(access);
self
}
fn write_access(&self, b: &mut CodeBuffer) {
self.access().write(b);
}
}