pub struct RequestContextBuilder { /* private fields */ }Expand description
Builds a RequestContext. Create one with RequestContext::builder.
Implementations§
Source§impl RequestContextBuilder
impl RequestContextBuilder
Sourcepub fn request_id(self, request_id: impl Into<String>) -> Self
pub fn request_id(self, request_id: impl Into<String>) -> Self
Sets the request ID. The default is a new UUID.
Sourcepub fn workload_access_token(self, token: WorkloadAccessToken) -> Self
pub fn workload_access_token(self, token: WorkloadAccessToken) -> Self
Sets the workload access token.
Sourcepub fn oauth2_callback_url(self, url: impl Into<String>) -> Self
pub fn oauth2_callback_url(self, url: impl Into<String>) -> Self
Sets the OAuth2 callback URL.
Sourcepub fn workload_identity_context(self, context: impl Into<String>) -> Self
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.
Sourcepub fn header(self, name: HeaderName, value: HeaderValue) -> Self
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.
Sourcepub fn request_header(self, name: HeaderName, value: HeaderValue) -> Self
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.
Sourcepub fn tasks(self, tasks: AsyncTasks) -> Self
pub fn tasks(self, tasks: AsyncTasks) -> Self
Sets the registry returned by RequestContext::tasks. The default is a new
empty registry.
Sourcepub fn build(self) -> RequestContext
pub fn build(self) -> RequestContext
Builds the context.
Trait Implementations§
Auto Trait Implementations§
impl Forget for RequestContextBuilder
impl Freeze for RequestContextBuilderwhere
*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 RequestContextBuilderwhere
Atomic<usize>: RefUnwindSafe,
Mutex<Vec<(String, String)>>: RefUnwindSafe,
Atomic<*mut ()>: RefUnwindSafe,
Atomic<u64>: RefUnwindSafe,
Mutex<HashMap<TaskId, Entry>>: RefUnwindSafe,
impl Send for RequestContextBuilder
impl Sync for RequestContextBuilder
impl Unpin for RequestContextBuilder
impl UnsafeUnpin for RequestContextBuilderwhere
*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 RequestContextBuilderwhere
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> 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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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