Skip to main content

RequestContextBuilder

Struct RequestContextBuilder 

Source
pub struct RequestContextBuilder { /* private fields */ }
Expand description

Builds a RequestContext. Create one with RequestContext::builder.

Implementations§

Source§

impl RequestContextBuilder

Source

pub fn request_id(self, request_id: impl Into<String>) -> Self

Sets the request ID. The default is a new UUID.

Source

pub fn workload_access_token(self, token: WorkloadAccessToken) -> Self

Sets the workload access token.

Source

pub fn oauth2_callback_url(self, url: impl Into<String>) -> Self

Sets the OAuth2 callback URL.

Source

pub fn workload_identity_context(self, context: impl Into<String>) -> Self

Sets the encrypted workload identity context of the session. The runtime server reads it from the X-Amzn-Bedrock-AgentCore-Runtime-Encrypted-Workload-Identity-Context header and keeps it for later invocations of the session. It is not in RequestContext::headers and Debug does not show it.

Source

pub fn header(self, name: HeaderName, value: HeaderValue) -> Self

Adds one entry to RequestContext::headers. The builder applies no filter.

The value is marked sensitive, so its Debug output does not show it.

Source

pub fn request_header(self, name: HeaderName, value: HeaderValue) -> Self

Adds one entry to RequestContext::request_headers.

The value is marked sensitive, so its Debug output does not show it.

Source

pub fn tasks(self, tasks: AsyncTasks) -> Self

Sets the registry returned by RequestContext::tasks. The default is a new empty registry.

Source

pub fn build(self) -> RequestContext

Builds the context.

Trait Implementations§

Source§

impl Debug for RequestContextBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for RequestContextBuilder

§

impl Freeze for RequestContextBuilder
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, *const ArcInner<Mutex<Vec<(String, String)>>> is !null: Freeze, PhantomData<ArcInner<Mutex<Vec<(String, String)>>>>: Freeze, *const [Pos] is !null: Freeze, PhantomData<[Pos]>: Freeze, PhantomData<Bucket<HeaderValue>>: Freeze, PhantomData<ExtraValue<HeaderValue>>: Freeze, *const ArcInner<Inner> is !null: Freeze, PhantomData<ArcInner<Inner>>: Freeze,

§

impl Move for RequestContextBuilder

§

impl RefUnwindSafe for RequestContextBuilder

§

impl Send for RequestContextBuilder
where RawVecInner: Send, Arc<Mutex<Vec<(String, String)>>>: Send, BoxRaw<[Pos]>: Send, Bytes: Send, Arc<Inner>: Send,

§

impl Sync for RequestContextBuilder
where RawVecInner: Sync, Arc<Mutex<Vec<(String, String)>>>: Sync, BoxRaw<[Pos]>: Sync, Bytes: Sync, Arc<Inner>: Sync,

§

impl Unpin for RequestContextBuilder
where *const u8 is !null: Unpin, Arc<Mutex<Vec<(String, String)>>>: Unpin, Box<[Pos]>: Unpin, *const u8: Unpin, Align8<*mut ()>: Unpin, &'static Vtable: Unpin, Arc<Inner>: Unpin,

§

impl UnsafeUnpin for RequestContextBuilder
where *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, *const ArcInner<Mutex<Vec<(String, String)>>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<Vec<(String, String)>>>>: UnsafeUnpin, *const [Pos] is !null: UnsafeUnpin, PhantomData<[Pos]>: UnsafeUnpin, PhantomData<Bucket<HeaderValue>>: UnsafeUnpin, PhantomData<ExtraValue<HeaderValue>>: UnsafeUnpin, *const ArcInner<Inner> is !null: UnsafeUnpin, PhantomData<ArcInner<Inner>>: UnsafeUnpin,

§

impl UnwindSafe for RequestContextBuilder
where RawVecInner: UnwindSafe, Arc<Mutex<Vec<(String, String)>>>: UnwindSafe, BoxRaw<[Pos]>: UnwindSafe, *const u8: UnwindSafe, Align8<*mut ()>: UnwindSafe, &'static Vtable: UnwindSafe, Arc<Inner>: UnwindSafe,

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more