Struct ImageGate
pub struct ImageGate { /* private fields */ }Expand description
The admission rules for one run, from what the history holds now. A call that offers several images shares one gate, so the run’s count is kept across them.
Implementations§
§impl ImageGate
impl ImageGate
pub fn new(
limits: Option<ImageLimits>,
count: usize,
room: Option<usize>,
) -> ImageGate
pub fn new( limits: Option<ImageLimits>, count: usize, room: Option<usize>, ) -> ImageGate
A gate for a model with limits (None: text only), a history that holds count images
and, for a run that keeps images in its own state, room bytes left there.
pub fn with_journal_left(self, left: Option<usize>) -> ImageGate
pub fn with_journal_left(self, left: Option<usize>) -> ImageGate
Bound the bytes of images that the steps of tools journal from now on to left
(MAX_RUN_JOURNALED_IMAGE_BYTES less what the run has journaled).
pub fn sees_from(&self, origin: ImageOrigin) -> bool
pub fn sees_from(&self, origin: ImageOrigin) -> bool
Whether the model can see an image that comes from origin.
pub fn check(
&self,
origin: ImageOrigin,
claimed: Option<&str>,
name: Option<&str>,
bytes: &[u8],
) -> Admission
pub fn check( &self, origin: ImageOrigin, claimed: Option<&str>, name: Option<&str>, bytes: &[u8], ) -> Admission
What becomes of bytes, which the sender says are of the type claimed and may have called
name. Pure: took counts an image that was admitted and kept.
pub fn took(&mut self, image: &ImageRef)
pub fn took(&mut self, image: &ImageRef)
An image was admitted and kept: the run’s count and, in state, its room go down.
pub fn without_journal_bound(self) -> ImageGate
pub fn without_journal_bound(self) -> ImageGate
The same gate with no bound on the journal: for the images of an inbound message, which the journal holds as references only.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ImageGate
impl RefUnwindSafe for ImageGate
impl Send for ImageGate
impl Sync for ImageGate
impl Unpin for ImageGate
impl UnsafeUnpin for ImageGate
impl UnwindSafe for ImageGate
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].