pub struct Gate { /* private fields */ }Implementations§
Source§impl Gate
impl Gate
Sourcepub fn check(
&mut self,
agent: &str,
block_id: &str,
app: &str,
now: u64,
) -> Check
pub fn check( &mut self, agent: &str, block_id: &str, app: &str, now: u64, ) -> Check
Whether agent (in pane block_id) may act on app now, counting
this as an action when it may.
Sourcepub fn asking(&self, agent: &str, block_id: &str, app: &str) -> bool
pub fn asking(&self, agent: &str, block_id: &str, app: &str) -> bool
Whether the user is already being asked about app for this agent and
pane: a call that finds so answers pending without a second prompt.
Sourcepub fn ask(&mut self, request: DesktopRequest) -> Receiver<Choice> ⓘ
pub fn ask(&mut self, request: DesktopRequest) -> Receiver<Choice> ⓘ
Queue a prompt for request; the answer arrives on the receiver. The
same agent asking again about the same app joins the prompt it has.
Sourcepub fn grant(
&mut self,
agent: &str,
block_id: &str,
app: &str,
minutes: Option<u64>,
now: u64,
)
pub fn grant( &mut self, agent: &str, block_id: &str, app: &str, minutes: Option<u64>, now: u64, )
Let agent in pane block_id control app: for minutes, or (None) until its session ends.
It replaces any grant that agent already has for the app.
Sourcepub fn answer(
&mut self,
id: &str,
choice: Choice,
now: u64,
grant_minutes: u64,
) -> Result<(), String>
pub fn answer( &mut self, id: &str, choice: Choice, now: u64, grant_minutes: u64, ) -> Result<(), String>
The user’s answer to prompt id.
Sourcepub fn stop(&mut self, block_id: &str) -> usize
pub fn stop(&mut self, block_id: &str) -> usize
The user’s Stop for the agent in pane block_id: its grants end and
its next action hears so. Prompts it has waiting are dropped.
Sourcepub fn has_grant(
&mut self,
agent: &str,
block_id: &str,
app: &str,
now: u64,
) -> bool
pub fn has_grant( &mut self, agent: &str, block_id: &str, app: &str, now: u64, ) -> bool
Whether agent in pane block_id holds a grant on app right now.
Sourcepub fn release(&mut self, agent: &str, block_id: &str, app: &str) -> bool
pub fn release(&mut self, agent: &str, block_id: &str, app: &str) -> bool
The agent gives its own grant on app back.
pub fn event(&mut self, now: u64) -> DesktopEvent
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Gate
impl !UnwindSafe for Gate
impl Freeze for Gate
impl Send for Gate
impl Sync for Gate
impl Unpin for Gate
impl UnsafeUnpin for Gate
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more