Skip to main content

Ctx

Struct Ctx 

Source
pub struct Ctx {
    pub modern: bool,
    pub tasks: bool,
    pub cancel: Arc<AtomicBool>,
    pub progress: Option<Value>,
    pub id: Value,
}
Expand description

One request: its era and whether it may be cancelled or report progress.

Fields§

§modern: bool

The request is served statelessly under revision 2026-07-28.

§tasks: bool

The client declared the Tasks extension on this request.

§cancel: Arc<AtomicBool>

Set when the client cancels the request.

§progress: Option<Value>

The request’s progress token, if it asked for progress.

§id: Value

The JSON-RPC ID of the request.

Implementations§

Source§

impl Ctx

Source

pub fn stopped(&self, server: &Server) -> bool

Whether the request was cancelled or the server is shutting down.

Auto Trait Implementations§

§

impl Forget for Ctx

§

impl Freeze for Ctx
where *const ArcInner<Atomic<bool>> is !null: Freeze, PhantomData<ArcInner<Atomic<bool>>>: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<Value>: Freeze, *const LeafNode<String, Value> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(String, Value)>>: Freeze,

§

impl Move for Ctx

§

impl RefUnwindSafe for Ctx

§

impl Send for Ctx
where Arc<Atomic<bool>>: Send, RawVecInner: Send, NodeRef<Owned, String, Value, LeafOrInternal>: Send, BoxRaw<(String, Value)>: Send,

§

impl Sync for Ctx
where Arc<Atomic<bool>>: Sync, RawVecInner: Sync, NodeRef<Owned, String, Value, LeafOrInternal>: Sync, BoxRaw<(String, Value)>: Sync,

§

impl Unpin for Ctx
where Arc<Atomic<bool>>: Unpin, *const u8 is !null: Unpin, *const LeafNode<String, Value> is !null: Unpin, Box<(String, Value)>: Unpin,

§

impl UnsafeUnpin for Ctx

§

impl UnwindSafe for Ctx

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.