silk/http_redirect
Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc.
Bounded, replay-aware HTTP redirect policy and scoped attempt orchestration.
When to use
Use Policy to admit finite redirect authority before an HTTP attempt. Select
withEmptyResponse, withBytesResponse, withOneShotResponse, or
withReplayResponse according to the request body's replay authority.
Details
This actor owns policy names, bounded redirect history, independently owned next-attempt state,
replay-aware body writing, intermediate-response cleanup, and final callback dispatch. Routed
acquisition remains behind AttemptClient; final responses are lent only to a higher-ranked
ResponseHandler.
Import as Redirect with import silk.http_redirect as Redirect.
Public declarations: 48.
Mode
pub enum ModeWhether a response is returned unchanged or eligible redirect statuses are followed.
Manual
Manual = 0Returns the first response without inspecting Location.
Follow
Follow = 1Applies the admitted redirect policy.
CrossOriginPolicy
pub enum CrossOriginPolicyWhether a cross-origin redirect is admitted.
Deny
Deny = 0Rejects every normalized-origin change.
Allow
Allow = 1Admits an origin change after deny-last header sanitization.
DowngradePolicy
pub enum DowngradePolicyWhether an HTTPS-to-HTTP redirect is admitted after cross-origin admission.
Deny
Deny = 0Rejects a secure-to-plaintext transition.
Allow
Allow = 1Admits a secure-to-plaintext transition after cross-origin sanitization.
Post301302Policy
pub enum Post301302PolicyThe special method rule for exact uppercase POST on status 301 or 302.
Preserve
Preserve = 0Preserves POST and its body.
ToGet
ToGet = 1Changes exact uppercase POST to GET and drops its body.
PreviousResponsePolicy
pub union PreviousResponsePolicyHow an intermediate response is handled before its attempt scope is released.
Close
PreviousResponsePolicy.Close: PreviousResponsePolicyPerforms no drain and lets the attempt owner close an incomplete response.
Drain
PreviousResponsePolicy.Drain { maxDiscardWireBytes: u64, deadline: Instant }: PreviousResponsePolicyAttempts a bounded discard under a finite absolute deadline.
Field maxDiscardWireBytes
pub maxDiscardWireBytes: u64Maximum response wire bytes that may be discarded.
Field deadline
pub deadline: InstantAbsolute discard deadline, later clamped to the operation deadline.
NameListLimits
pub struct NameListLimitsFinite admission limits for one owned case-insensitive field-name list.
Field maxNames
pub maxNames: usizeMaximum number of names, including duplicates.
Field maxNameBytes
pub maxNameBytes: usizeMaximum bytes in any one name.
Field maxOwnedBytes
pub maxOwnedBytes: usizeMaximum aggregate name payload plus owned index storage.
Implementation Copy for NameListLimits
impl Copy for NameListLimitsNameList
pub struct NameListA bounded owned list of validated HTTP field names.
Associated function NameList.empty
pub fn empty() -> NameListCreates an empty admitted list without allocating.
Associated function NameList.copy
pub effect<'env> fn copy<'life0: 'env, 'life1: 'env, 'env>(names: &'life0 [string<'life1>], limits: NameListLimits) -> silk/result.Result<silk/http_redirect.NameList, silk/http_redirect.RedirectError> ! OutOfMemoryError ? &mut AllocatorValidates and copies field names under exact count, per-name, and owned-byte boundaries.
Method NameList.contains
pub fn contains<'life0, 'life1>(self: &'life0 NameList, name: string<'life1>) -> boolReports ASCII case-insensitive membership without allocating.
Method NameList.count
pub fn count<'life0>(self: &'life0 NameList) -> usizeReturns the number of owned names.
Method NameList.ownedBytes
pub fn ownedBytes<'life0>(self: &'life0 NameList) -> usizeReturns accounted payload plus index storage bytes.
HistoryLimits
pub struct HistoryLimitsFinite URI, hop, and history capacities for one redirect operation.
Field maxHops
pub maxHops: usizeMaximum followed redirects.
Field maxUriBytes
pub maxUriBytes: usizeMaximum bytes in each raw or resolved URI serialization.
Field maxHistoryBytes
pub maxHistoryBytes: usizeMaximum serialized key bytes in the preallocated history arena.
Implementation Copy for HistoryLimits
impl Copy for HistoryLimitsPolicy
pub struct PolicyAn immutable admitted redirect policy with owned field-name lists.
Associated function Policy.defaults
pub fn defaults() -> PolicyReturns Manual policy with the standard finite redirect limits and no admitted custom names.
Details
The result permits 10 hops, 8192 URI bytes, and 90112 history bytes. It denies origin changes and downgrades, preserves POST for 301 and 302, and closes intermediate responses. Both owned name lists are empty.
Associated function Policy.make
pub fn make(mode: Mode, history: HistoryLimits, crossOrigin: CrossOriginPolicy, downgrade: DowngradePolicy, post301302: Post301302Policy, previousResponse: PreviousResponsePolicy, safeCustom: NameList, sensitive: NameList) -> silk/result.Result<silk/http_redirect.Policy, silk/http_redirect.RedirectError>Admits an immutable policy, rejecting list overlap and hop-count overflow before I/O.
Method Policy.mode
pub fn mode<'life0>(self: &'life0 Policy) -> ModeReturns whether responses are returned manually or followed.
Method Policy.historyLimits
pub fn historyLimits<'life0>(self: &'life0 Policy) -> HistoryLimitsReturns admitted URI, history, and hop capacities.
Method Policy.crossOrigin
pub fn crossOrigin<'life0>(self: &'life0 Policy) -> CrossOriginPolicyReturns cross-origin admission policy.
Method Policy.downgrade
pub fn downgrade<'life0>(self: &'life0 Policy) -> DowngradePolicyReturns HTTPS-to-HTTP downgrade policy.
Method Policy.post301302
pub fn post301302<'life0>(self: &'life0 Policy) -> Post301302PolicyReturns exact POST behavior for 301 and 302.
Method Policy.previousResponse
pub fn previousResponse<'life0>(self: &'life0 Policy) -> &'life0 silk/http_redirect.PreviousResponsePolicyBorrows intermediate-response cleanup policy.
Method Policy.safeCustom
pub fn safeCustom<'life0>(self: &'life0 Policy) -> &'life0 silk/http_redirect.NameListBorrows the admitted cross-origin safe-custom field names.
Method Policy.sensitive
pub fn sensitive<'life0>(self: &'life0 Policy) -> &'life0 silk/http_redirect.NameListBorrows the admitted always-sensitive field names.
RedirectComponent
pub enum RedirectComponentThe bounded value whose admission or transition failed.
Policy
Policy = 0The admitted policy and its owned lists.
Location
Location = 1A response Location field.
Uri
Uri = 2The resolved next URI.
Origin
Origin = 3The normalized destination origin.
History
History = 4The method-aware redirect history.
Body
Body = 5The current body replay authority.
RedirectLimit
pub enum RedirectLimitThe finite redirect resource that exceeded its bound.
PolicyNames
PolicyNames = 0Owned policy-name count.
PolicyNameBytes
PolicyNameBytes = 1One policy-name byte count.
PolicyOwnedBytes
PolicyOwnedBytes = 2Aggregate policy-name payload and index storage.
UriBytes
UriBytes = 3Raw or resolved URI bytes.
HistoryEntries
HistoryEntries = 4Method-aware history entries.
HistoryBytes
HistoryBytes = 5Aggregate serialized history-key bytes.
RedirectReason
pub union RedirectReasonA redirect-specific failure reason without response or credential borrows.
InvalidPolicy
RedirectReason.InvalidPolicy: RedirectReasonPolicy arithmetic or values cannot be admitted.
NameListOverlap
RedirectReason.NameListOverlap: RedirectReasonA name appears in both the safe-custom and sensitive lists.
SizeOverflow
RedirectReason.SizeOverflow: RedirectReasonRequired finite storage does not fit in usize.
LimitExceeded
RedirectReason.LimitExceeded { limit: RedirectLimit, allowed: usize, attempted: usize }: RedirectReasonA finite resource exceeds its inclusive bound.
Field limit
pub limit: RedirectLimitThe resource whose limit was exceeded.
Field allowed
pub allowed: usizeThe inclusive admitted maximum.
Field attempted
pub attempted: usizeThe rejected resource value.
LocationMissing
RedirectReason.LocationMissing: RedirectReasonA selected redirect has no Location field.
LocationAmbiguous
RedirectReason.LocationAmbiguous: RedirectReasonA selected redirect has more than one Location field.
LocationInvalid
RedirectReason.LocationInvalid: RedirectReasonA Location field is not UTF-8 or is not a valid URI reference.
RedirectSchemeDenied
RedirectReason.RedirectSchemeDenied: RedirectReasonThe resolved URI is not an admitted HTTP or HTTPS origin.
RedirectOriginDenied
RedirectReason.RedirectOriginDenied: RedirectReasonPolicy rejects a normalized-origin change.
DowngradeDenied
RedirectReason.DowngradeDenied: RedirectReasonPolicy rejects an HTTPS-to-HTTP transition.
HopLimit
RedirectReason.HopLimit: RedirectReasonA selected redirect has no remaining hop capacity.
RedirectLoop
RedirectReason.RedirectLoop: RedirectReasonA transformed method and request target repeat an earlier history key.
ReplayUnavailable
RedirectReason.ReplayUnavailable: RedirectReasonA retained body has no replay authority.
ReplayContractMismatch
RedirectReason.ReplayContractMismatch: RedirectReasonA producer's framing or observed length violates its declared contract.
Implementation Copy for RedirectReason
impl Copy for RedirectReasonRedirectContext
pub struct RedirectContextIndependently owned, bounded context attached at the redirect boundary.
Field hop
pub hop: usizeZero-based current attempt number.
Field status
pub status: silk/option.Option<silk/http.Status>Response status when one is relevant.
Field currentUri
pub currentUri: silk/option.Option<silk/uri.OwnedUri>Independently owned current URI when retained by the failure boundary.
Field nextUri
pub nextUri: silk/option.Option<silk/uri.OwnedUri>Independently owned next URI when retained by the failure boundary.
RedirectError
pub struct RedirectErrorA redirect-specific failure with no response, credential, body, or proxy-token borrow.
Field component
pub component: RedirectComponentThe bounded value associated with the failure.
Field reason
pub reason: RedirectReasonThe stable machine-readable failure reason.
Field context
pub context: RedirectContextIndependently owned bounded transition context.
Request
pub struct Request<'uri, 'method, 'headers, 'policy>A rebuildable semantic request, distinct from an owned serialized prepared request.
Field uri
pub uri: silk/uri.Uri<'uri>Caller-owned initial URI, including fragment metadata.
Field method
pub method: silk/http.Method<'method>Caller-owned initial method with exact spelling.
Field headers
pub headers: silk/http_headers.Headers<'headers>Caller-owned semantic fields, excluding generated framing and authority fields.
Field headerPolicy
pub headerPolicy: silk/http_request.HeaderPolicy<'policy>Caller-owned generated-field and credential policy.
Field version
pub version: VersionHTTP version used for every rebuilt attempt.
Field continuePolicy
pub continuePolicy: ContinuePolicyUpload expectation policy used for every rebuilt attempt.
Field limits
pub limits: HeaderLimitsShared request and owned-header value limits.
Field maxHeadBytes
pub maxHeadBytes: usizeMaximum bytes in each owned serialized request head.
Field maxCredentialBytes
pub maxCredentialBytes: usizeMaximum generated credential bytes in each request head.
AttemptRequest
pub struct AttemptRequest<'policy>Owned semantic state for rebuilding exactly one redirect attempt.
Details
The attempt client borrows views from these owners only inside its higher-ranked handler call. It must rebuild a fresh prepared request after route selection rather than retaining serialized bytes from an earlier origin.
Field uri
pub uri: OwnedUriIndependently owned current URI, including fragment metadata outside the wire target.
Field method
pub method: StringIndependently owned exact method spelling.
Field headers
pub headers: OwnedHeadersIndependently owned ordered semantic fields before generated-field preparation.
Field headerPolicy
pub headerPolicy: silk/http_request.HeaderPolicy<'policy>Generated-field and origin-credential policy borrowing caller-owned bytes.
Field version
pub version: VersionHTTP version selected for this attempt.
Field continuePolicy
pub continuePolicy: ContinuePolicyUpload expectation policy paired with the prepared request.
Field requestLimits
pub requestLimits: HeaderLimitsShared method, target, field, and owned-header bounds used during preparation.
Field maxHeadBytes
pub maxHeadBytes: usizeMaximum bytes in the newly owned serialized request head.
Field maxCredentialBytes
pub maxCredentialBytes: usizeMaximum generated origin or proxy credential bytes in the request head.
Field bodyMode
pub bodyMode: BodyModeExact body delimiter that orchestration validates against its source before acquisition.
crossOriginHeaderPolicy
pub fn crossOriginHeaderPolicy<'value>(policy: silk/http_request.HeaderPolicy<'value>) -> silk/http_request.HeaderPolicy<'value>Returns generated-field policy for a cross-origin attempt without origin credentials.
When to use
Use before request preparation after admitOrigin reports an origin change.
Details
The result selects the next normalized origin for Host and removes generated Authorization. It preserves User-Agent, Accept, Basic security, and HTTP/1.0 persistence controls.
BodyChunk
pub struct BodyChunkThe result of pulling one bounded producer chunk into caller storage.
Field length
pub length: usizeNumber of initialized bytes written at the start of caller storage.
Field end
pub end: boolWhether no later pull may produce bytes.
Implementation Copy for BodyChunk
impl Copy for BodyChunkBodyProducer
pub interface BodyProducer<E, ?R>A scoped body source with explicit framing metadata and bounded pulls.
Operation mode
fn mode<'life2>(producer: &'life2 Self) -> BodyModeReturns framing metadata before an attempt writes its request head.
Operation pull
effect<'env> fn pull<'life2: 'env, 'life3: 'env, 'env>(producer: &'life2 mut Self, output: &'life3 mut [u8]) -> BodyChunk ! E ? RInitializes at most output.length bytes and reports progress without retaining output.
ReplayFactory
pub interface ReplayFactory<P, FactoryError, ?FactoryRequirements>A reusable factory that lends one fresh scoped producer for each attempted request.
Details
Redirect orchestration owns each acquired producer and brackets it through one complete
attempt. release is infallible and non-suspending, so cleanup cannot replace the attempt's
success or failure. Factory result and callback types remain outside this public contract.
Operation acquire
effect<'env> fn acquire<'life3: 'env, 'env>(factory: &'life3 mut Self) -> P ! FactoryError ? FactoryRequirementsAcquires one fresh owned producer for the next retained-body attempt.
Operation release
fn release<'life3, 'life4>(factory: &'life3 mut Self, producer: &'life4 mut P) -> ()Releases one acquired producer after success, failure, or structured cancellation.
AttemptBody
pub union AttemptBody<'bytes, 'oneShot, 'replay, OneShot, ReplayProducer>One attempt's uniform producer authority after replay selection.
Details
Empty and repeatable-byte attempts are implemented inside this actor. Producer variants lend the already-selected OneShot or factory producer without erasing either channel family.
Empty
AttemptBody<'bytes, 'oneShot, 'replay, OneShot, ReplayProducer>.Empty: AttemptBody<'bytes, 'oneShot, 'replay, OneShot, ReplayProducer>Completes one body-free attempt without consulting a producer.
RepeatableBytes
AttemptBody<'bytes, 'oneShot, 'replay, OneShot, ReplayProducer>.RepeatableBytes { bytes: &'bytes [u8], offset: usize }: AttemptBody<'bytes, 'oneShot, 'replay, OneShot, ReplayProducer>Reads one attempt from immutable caller bytes through a private cursor.
OneShot
AttemptBody<'bytes, 'oneShot, 'replay, OneShot, ReplayProducer>.OneShot { producer: &'oneShot mut OneShot }: AttemptBody<'bytes, 'oneShot, 'replay, OneShot, ReplayProducer>Lends the affine producer consumed for this attempt.
ReplayFactory
AttemptBody<'bytes, 'oneShot, 'replay, OneShot, ReplayProducer>.ReplayFactory { producer: &'replay mut ReplayProducer }: AttemptBody<'bytes, 'oneShot, 'replay, OneShot, ReplayProducer>Lends the fresh producer owned by the current replay-factory scope.
BodyWriteOutcome
pub union BodyWriteOutcomeWhether the shared writer completed upload or received a final response before pulling bytes.
Completed
BodyWriteOutcome.Completed { status: u16 }: BodyWriteOutcomeUpload framing finished and one final response is ready for body handling.
Field status
pub status: u16Final response status.
EarlyFinal
BodyWriteOutcome.EarlyFinal { status: u16 }: BodyWriteOutcomeRequire100 received a final response before the first producer pull.
Field status
pub status: u16Final response status.
Attempt
pub service Attempt<'policy, P, A, E, ?R>A higher-ranked routed-attempt callback provided lexically by redirect orchestration.
Details
Acquisition clients invoke this service once after request preparation and scoped connection acquisition. Naming the service in a requirement row preserves exact handler channels without exposing redirect's concrete callback adapter.
Operation handle
effect<'call> fn handle<'call: 'call, 'exchangeView: 'call, 'transport: 'exchangeView + 'call, 'provider: 'transport + 'call, 'tunnel: 'provider + 'call>(request: &'call silk/http_redirect.AttemptRequest<'policy>, method: silk/http.Method<'call>, exchange: &'call mut silk/http_client.Exchange<'exchangeView, silk/http_client.RouteTransport<'transport, 'provider, 'tunnel, P>>) -> A ! E ? R | &mut silk/http_redirect.Attempt<'policy, P, A, E, ? R> where &mut P provides &HttpTransport from &mut HttpTransport | &mut MonotonicClock | &mut Allocator | &mut Random, &mut P provides &HttpTransport from &mut HttpTransport, &mut P provides &ByteDuplex from &mut ByteDuplex | &mut MonotonicClock | &mut Allocator | &mut Random, &mut P provides &ByteDuplex from &mut ByteDuplexHandles one live routed exchange inside its acquisition bracket.
AttemptClient
pub interface AttemptClient<'policy, P, A, HandlerError, AcquisitionError, ?AcquisitionRequirements, ?HandlerRequirements>A routed HTTP acquisition boundary for one rebuilt redirect attempt.
When to use
Implement this interface beside routed connection acquisition, then pass it to redirect orchestration without exposing sockets, TLS state, proxy credentials, or pooled leases.
Details
withAttempt consumes and retains request through its complete bracket. It derives one
validated method and the URI/header views from that owner, selects the current route, prepares a
new origin- or absolute-form request, acquires its physical peer under the unchanged absolute
deadline, and invokes exactly one http_client.withExchange. The same method view, a fresh
request borrow, and the resulting exchange are lent only through Attempt, so redirect
transition and sanitization do not copy semantic state or reparse the method. Handler and source
errors remain direct. AcquisitionError directly carries preparation, route, acquisition, and
exchange-admission failures without wrapping either channel family.
Gotchas
The implementation must release its transport after handler success, typed failure, defect, or cancellation. It must not return the fresh request borrow, method view, transport loan, or exchange loan.
Operation withAttempt
effect<'env> fn withAttempt<'life7: 'env, 'env>(client: &'life7 mut Self, request: silk/http_redirect.AttemptRequest<'policy>, deadline: silk/option.Option<silk/system_clock.Instant>) -> A ! HandlerError | AcquisitionError ? HandlerRequirements | AcquisitionRequirements | &mut silk/http_redirect.Attempt<'policy, P, A, HandlerError, ? HandlerRequirements> where HandlerRequirements in Without<HandlerRequirements, &ByteDuplex>, HandlerRequirements in Without<HandlerRequirements, &HttpTransport>Rebuilds, acquires, and drives one scoped request while preserving both channel families.
HybridAttempt
pub service HybridAttempt<'policy, RoutedP, DirectP, A, E, ?R>A higher-ranked callback for one routed or direct redirect attempt.
Details
A routed client calls handleRouted with its final routed transport. A direct client calls
handleDirect with its direct HTTP transport. Each operation lends the same owned request and
validated method only for its exchange scope. Neither exchange form can escape in A.
Operation handleRouted
effect<'call> fn handleRouted<'call: 'call, 'exchangeView: 'call, 'transport: 'exchangeView + 'call, 'provider: 'transport + 'call, 'tunnel: 'provider + 'call>(request: &'call silk/http_redirect.AttemptRequest<'policy>, method: silk/http.Method<'call>, exchange: &'call mut silk/http_client.Exchange<'exchangeView, silk/http_client.RouteTransport<'transport, 'provider, 'tunnel, RoutedP>>) -> A ! E ? R | &mut silk/http_redirect.HybridAttempt<'policy, RoutedP, DirectP, A, E, ? R> where &mut RoutedP provides &HttpTransport from &mut HttpTransport | &mut MonotonicClock | &mut Allocator | &mut Random, &mut RoutedP provides &HttpTransport from &mut HttpTransport, &mut RoutedP provides &ByteDuplex from &mut ByteDuplex | &mut MonotonicClock | &mut Allocator | &mut Random, &mut RoutedP provides &ByteDuplex from &mut ByteDuplexHandles one routed exchange after route preparation and acquisition finish.
Operation handleDirect
effect<'call> fn handleDirect<'call: 'call, 'exchangeView: 'call>(request: &'call silk/http_redirect.AttemptRequest<'policy>, method: silk/http.Method<'call>, exchange: &'call mut silk/http_client.Exchange<'exchangeView, DirectP>) -> A ! E ? R | &mut silk/http_redirect.HybridAttempt<'policy, RoutedP, DirectP, A, E, ? R> where &mut DirectP provides &HttpTransport from &mut HttpTransport | &mut MonotonicClock | &mut Allocator | &mut Random, &mut DirectP provides &HttpTransport from &mut HttpTransportHandles one direct exchange after direct request preparation and acquisition finish.
HybridAttemptClient
pub interface HybridAttemptClient<'policy, RoutedP, DirectP, A, HandlerError, AcquisitionError, ?AcquisitionRequirements, ?HandlerRequirements>A routed-or-direct acquisition boundary for one rebuilt redirect attempt.
Details
The client selects one acquisition form before contact and calls exactly one handler operation. It preserves the unchanged deadline and both caller-defined channel families. The direct form does not require duplex authority because it cannot establish a CONNECT tunnel.
Operation withAttempt
effect<'env> fn withAttempt<'life8: 'env, 'env>(client: &'life8 mut Self, request: silk/http_redirect.AttemptRequest<'policy>, deadline: silk/option.Option<silk/system_clock.Instant>) -> A ! HandlerError | AcquisitionError ? HandlerRequirements | AcquisitionRequirements | &mut silk/http_redirect.HybridAttempt<'policy, RoutedP, DirectP, A, HandlerError, ? HandlerRequirements> where HandlerRequirements in Without<HandlerRequirements, &ByteDuplex>, HandlerRequirements in Without<HandlerRequirements, &HttpTransport>Rebuilds, acquires, and drives one routed or direct scoped request.
ResponseHandler
pub interface ResponseHandler<P, A, E, ?R>A higher-ranked callback for the one final response selected by redirect orchestration.
When to use
Pass an implementation to one of the four with*Response operations to consume the final
response while its routed exchange is live.
Details
uri borrows the independently owned final URI only for handle. hop is the number of
redirects followed. Neither the URI nor exchange loan can escape in A.
Operation handle
effect<'call> fn handle<'call: 'call, 'exchangeView: 'call, 'transport: 'exchangeView + 'call, 'provider: 'transport + 'call, 'tunnel: 'provider + 'call, 'life9: 'call>(handler: &'life9 mut Self, uri: silk/uri.Uri<'call>, hop: usize, exchange: &'call mut silk/http_client.Exchange<'exchangeView, silk/http_client.RouteTransport<'transport, 'provider, 'tunnel, P>>) -> A ! E ? R where &mut P provides &HttpTransport from &mut HttpTransport | &mut MonotonicClock | &mut Allocator | &mut Random, &mut P provides &HttpTransport from &mut HttpTransport, &mut P provides &ByteDuplex from &mut ByteDuplex | &mut MonotonicClock | &mut Allocator | &mut Random, &mut P provides &ByteDuplex from &mut ByteDuplexHandles exactly one selected final response.
HybridResponseHandler
pub interface HybridResponseHandler<RoutedP, DirectP, A, E, ?R>A final-response callback that accepts either a routed or a direct exchange.
When to use
Use with the four with*HybridResponse operations when one acquisition context can select a
proxy-aware route or a direct pooled connection.
Details
The acquisition client calls exactly one operation. Each operation lends the independently owned final URI and live exchange only for that call.
Operation handleRouted
effect<'call> fn handleRouted<'call: 'call, 'exchangeView: 'call, 'transport: 'exchangeView + 'call, 'provider: 'transport + 'call, 'tunnel: 'provider + 'call, 'life10: 'call>(handler: &'life10 mut Self, uri: silk/uri.Uri<'call>, hop: usize, exchange: &'call mut silk/http_client.Exchange<'exchangeView, silk/http_client.RouteTransport<'transport, 'provider, 'tunnel, RoutedP>>) -> A ! E ? R where &mut RoutedP provides &HttpTransport from &mut HttpTransport | &mut MonotonicClock | &mut Allocator | &mut Random, &mut RoutedP provides &HttpTransport from &mut HttpTransport, &mut RoutedP provides &ByteDuplex from &mut ByteDuplex | &mut MonotonicClock | &mut Allocator | &mut Random, &mut RoutedP provides &ByteDuplex from &mut ByteDuplexHandles exactly one final response on a routed transport.
Operation handleDirect
effect<'call> fn handleDirect<'call: 'call, 'exchangeView: 'call, 'life7: 'call>(handler: &'life7 mut Self, uri: silk/uri.Uri<'call>, hop: usize, exchange: &'call mut silk/http_client.Exchange<'exchangeView, DirectP>) -> A ! E ? R where &mut DirectP provides &HttpTransport from &mut HttpTransport | &mut MonotonicClock | &mut Allocator | &mut Random, &mut DirectP provides &HttpTransport from &mut HttpTransportHandles exactly one final response on a direct HTTP transport.
SelectedBody
pub service SelectedBody<E, ?R>Opaque selected request-body authority used while a redirect attempt is live.
Details
Redirect orchestration provides this service only inside the scoped attempt callback. Clients may name it to preserve exact requirement rows, but cannot retain its producer or body loan.
Operation pull
effect<'life2> fn pull<'life2>(output: &'life2 mut [u8]) -> BodyChunk ! E ? R | &mut silk/http_redirect.SelectedBody<E, ? R>Writes the next selected request-body chunk into output without retaining the buffer.
AttemptStep
pub union AttemptStep<'policy, A>Opaque outcome of one redirect attempt.
Details
Acquisition clients may name this result in exact conformance bounds. Redirect orchestration alone constructs and consumes its state, history, and transition authority.
Final
AttemptStep<'policy, A>.Final { value: A }: AttemptStep<'policy, A>Redirect
AttemptStep<'policy, A>.Redirect { state: silk/http_redirect.RedirectState<'policy>, history: History, body: BodyDecision }: AttemptStep<'policy, A>withEmptyResponse
pub effect<'env> fn withEmptyResponse<'client: 'env, 'uri: 'env, 'method: 'env, 'headers: 'env, 'policy: 'env, 'scratch: 'env, P, A, CallbackError, AcquisitionError, ?CallbackRequirements, ?AcquisitionRequirements, H: 'env, C: 'env, 'env>(client: &'client mut C, request: silk/http_redirect.Request<'uri, 'method, 'headers, 'policy>, policy: &'policy silk/http_redirect.Policy, deadline: silk/option.Option<silk/system_clock.Instant>, scratch: &'scratch mut [u8], handler: H) -> A ! RedirectError | ValueError | CallbackError | ClientError | OutOfMemoryError | AcquisitionError ? CallbackRequirements | AcquisitionRequirements | &mut MonotonicClock | &mut Allocator | &mut Random where &mut P provides &HttpTransport from &mut HttpTransport | &mut MonotonicClock | &mut Allocator | &mut Random, &mut P provides &HttpTransport from &mut HttpTransport, &mut P provides &ByteDuplex from &mut ByteDuplex | &mut MonotonicClock | &mut Allocator | &mut Random, &mut P provides &ByteDuplex from &mut ByteDuplex, CallbackRequirements in Without<CallbackRequirements, &ByteDuplex>, CallbackRequirements in Without<CallbackRequirements, &HttpTransport>, AcquisitionRequirements in Without<AcquisitionRequirements, &ByteDuplex>, AcquisitionRequirements in Without<AcquisitionRequirements, &HttpTransport>Follows a body-free request and lends exactly one final response.
When to use
Use when every retained redirect can repeat an empty request without source authority.
Details
Each attempt is rebuilt under the unchanged caller deadline. Intermediate responses are closed
or boundedly drained according to policy. If orchestration reaches a final response,
handler runs exactly once; an earlier failure does not invoke it.
withEmptyHybridResponse
pub effect<'env> fn withEmptyHybridResponse<'client: 'env, 'uri: 'env, 'method: 'env, 'headers: 'env, 'policy: 'env, 'scratch: 'env, RoutedP, DirectP, A, CallbackError, AcquisitionError, ?CallbackRequirements, ?AcquisitionRequirements, H: 'env, C: 'env, 'env>(client: &'client mut C, request: silk/http_redirect.Request<'uri, 'method, 'headers, 'policy>, policy: &'policy silk/http_redirect.Policy, deadline: silk/option.Option<silk/system_clock.Instant>, scratch: &'scratch mut [u8], handler: H) -> A ! RedirectError | ValueError | CallbackError | ClientError | OutOfMemoryError | AcquisitionError ? CallbackRequirements | AcquisitionRequirements | &mut MonotonicClock | &mut Allocator | &mut Random where &mut RoutedP provides &HttpTransport from &mut HttpTransport | &mut MonotonicClock | &mut Allocator | &mut Random, &mut RoutedP provides &HttpTransport from &mut HttpTransport, &mut RoutedP provides &ByteDuplex from &mut ByteDuplex | &mut MonotonicClock | &mut Allocator | &mut Random, &mut RoutedP provides &ByteDuplex from &mut ByteDuplex, &mut DirectP provides &HttpTransport from &mut HttpTransport | &mut MonotonicClock | &mut Allocator | &mut Random, &mut DirectP provides &HttpTransport from &mut HttpTransport, CallbackRequirements in Without<CallbackRequirements, &ByteDuplex>, CallbackRequirements in Without<CallbackRequirements, &HttpTransport>, AcquisitionRequirements in Without<AcquisitionRequirements, &ByteDuplex>, AcquisitionRequirements in Without<AcquisitionRequirements, &HttpTransport>Follows a body-free request through a client that can select routed or direct acquisition.
Details
Each attempt uses one acquisition form. The operation reuses the same iterative redirect state
machine as withEmptyResponse and invokes handler exactly once for the final response.
withBytesResponse
pub effect<'env> fn withBytesResponse<'client: 'env, 'uri: 'env, 'method: 'env, 'headers: 'env, 'policy: 'env, 'bytes: 'env, 'scratch: 'env, P, A, CallbackError, AcquisitionError, ?CallbackRequirements, ?AcquisitionRequirements, H: 'env, C: 'env, 'env>(client: &'client mut C, request: silk/http_redirect.Request<'uri, 'method, 'headers, 'policy>, policy: &'policy silk/http_redirect.Policy, bytes: &'bytes [u8], deadline: silk/option.Option<silk/system_clock.Instant>, scratch: &'scratch mut [u8], handler: H) -> A ! RedirectError | ValueError | CallbackError | ClientError | OutOfMemoryError | AcquisitionError ? CallbackRequirements | AcquisitionRequirements | &mut MonotonicClock | &mut Allocator | &mut Random where &mut P provides &HttpTransport from &mut HttpTransport | &mut MonotonicClock | &mut Allocator | &mut Random, &mut P provides &HttpTransport from &mut HttpTransport, &mut P provides &ByteDuplex from &mut ByteDuplex | &mut MonotonicClock | &mut Allocator | &mut Random, &mut P provides &ByteDuplex from &mut ByteDuplex, CallbackRequirements in Without<CallbackRequirements, &ByteDuplex>, CallbackRequirements in Without<CallbackRequirements, &HttpTransport>, AcquisitionRequirements in Without<AcquisitionRequirements, &ByteDuplex>, AcquisitionRequirements in Without<AcquisitionRequirements, &HttpTransport>Follows a request using immutable bytes that can be replayed without resource acquisition.
When to use
Use for a complete in-memory body whose borrow remains live for the redirect operation.
Details
Every retained-body attempt starts a fresh cursor at byte zero. A transition that drops content changes all later attempts to empty framing. Nonempty bytes require nonempty body scratch before the first routed attempt can be acquired.
withBytesHybridResponse
pub effect<'env> fn withBytesHybridResponse<'client: 'env, 'uri: 'env, 'method: 'env, 'headers: 'env, 'policy: 'env, 'bytes: 'env, 'scratch: 'env, RoutedP, DirectP, A, CallbackError, AcquisitionError, ?CallbackRequirements, ?AcquisitionRequirements, H: 'env, C: 'env, 'env>(client: &'client mut C, request: silk/http_redirect.Request<'uri, 'method, 'headers, 'policy>, policy: &'policy silk/http_redirect.Policy, bytes: &'bytes [u8], deadline: silk/option.Option<silk/system_clock.Instant>, scratch: &'scratch mut [u8], handler: H) -> A ! RedirectError | ValueError | CallbackError | ClientError | OutOfMemoryError | AcquisitionError ? CallbackRequirements | AcquisitionRequirements | &mut MonotonicClock | &mut Allocator | &mut Random where &mut RoutedP provides &HttpTransport from &mut HttpTransport | &mut MonotonicClock | &mut Allocator | &mut Random, &mut RoutedP provides &HttpTransport from &mut HttpTransport, &mut RoutedP provides &ByteDuplex from &mut ByteDuplex | &mut MonotonicClock | &mut Allocator | &mut Random, &mut RoutedP provides &ByteDuplex from &mut ByteDuplex, &mut DirectP provides &HttpTransport from &mut HttpTransport | &mut MonotonicClock | &mut Allocator | &mut Random, &mut DirectP provides &HttpTransport from &mut HttpTransport, CallbackRequirements in Without<CallbackRequirements, &ByteDuplex>, CallbackRequirements in Without<CallbackRequirements, &HttpTransport>, AcquisitionRequirements in Without<AcquisitionRequirements, &ByteDuplex>, AcquisitionRequirements in Without<AcquisitionRequirements, &HttpTransport>Follows replayable bytes through a client that can select routed or direct acquisition.
Details
Every retained-body attempt starts at byte zero. A dropped-body transition changes all later attempts to empty framing. A nonempty body requires positive scratch before contact.
withOneShotResponse
pub effect<'env> fn withOneShotResponse<'client: 'env, 'uri: 'env, 'method: 'env, 'headers: 'env, 'policy: 'env, 'scratch: 'env, P, A, ProducerError, CallbackError, AcquisitionError, ?ProducerRequirements, ?CallbackRequirements, ?AcquisitionRequirements, Producer: 'env, H: 'env, C: 'env, 'env>(client: &'client mut C, request: silk/http_redirect.Request<'uri, 'method, 'headers, 'policy>, policy: &'policy silk/http_redirect.Policy, producer: Producer, deadline: silk/option.Option<silk/system_clock.Instant>, scratch: &'scratch mut [u8], handler: H) -> A ! RedirectError | ValueError | ProducerError | CallbackError | ClientError | OutOfMemoryError | AcquisitionError ? ProducerRequirements | CallbackRequirements | AcquisitionRequirements | &mut MonotonicClock | &mut Allocator | &mut Random where &mut P provides &HttpTransport from &mut HttpTransport | &mut MonotonicClock | &mut Allocator | &mut Random, &mut P provides &HttpTransport from &mut HttpTransport, &mut P provides &ByteDuplex from &mut ByteDuplex | &mut MonotonicClock | &mut Allocator | &mut Random, &mut P provides &ByteDuplex from &mut ByteDuplex, ProducerRequirements in Without<ProducerRequirements, &ByteDuplex>, ProducerRequirements in Without<ProducerRequirements, &HttpTransport>, CallbackRequirements in Without<CallbackRequirements, &ByteDuplex>, CallbackRequirements in Without<CallbackRequirements, &HttpTransport>, AcquisitionRequirements in Without<AcquisitionRequirements, &ByteDuplex>, AcquisitionRequirements in Without<AcquisitionRequirements, &HttpTransport>Follows redirects while consuming one affine body producer at most once.
When to use
Use when the first attempted body cannot be recreated for a retained redirect.
Details
Producer framing and scratch are checked before routed acquisition. The first attempt spends
producer authority even when Require100 returns an early final response. A retained-body
redirect fails with ReplayUnavailable; a dropped-body redirect continues empty.
withOneShotHybridResponse
pub effect<'env> fn withOneShotHybridResponse<'client: 'env, 'uri: 'env, 'method: 'env, 'headers: 'env, 'policy: 'env, 'scratch: 'env, RoutedP, DirectP, A, ProducerError, CallbackError, AcquisitionError, ?ProducerRequirements, ?CallbackRequirements, ?AcquisitionRequirements, Producer: 'env, H: 'env, C: 'env, 'env>(client: &'client mut C, request: silk/http_redirect.Request<'uri, 'method, 'headers, 'policy>, policy: &'policy silk/http_redirect.Policy, producer: Producer, deadline: silk/option.Option<silk/system_clock.Instant>, scratch: &'scratch mut [u8], handler: H) -> A ! RedirectError | ValueError | ProducerError | CallbackError | ClientError | OutOfMemoryError | AcquisitionError ? ProducerRequirements | CallbackRequirements | AcquisitionRequirements | &mut MonotonicClock | &mut Allocator | &mut Random where &mut RoutedP provides &HttpTransport from &mut HttpTransport | &mut MonotonicClock | &mut Allocator | &mut Random, &mut RoutedP provides &HttpTransport from &mut HttpTransport, &mut RoutedP provides &ByteDuplex from &mut ByteDuplex | &mut MonotonicClock | &mut Allocator | &mut Random, &mut RoutedP provides &ByteDuplex from &mut ByteDuplex, &mut DirectP provides &HttpTransport from &mut HttpTransport | &mut MonotonicClock | &mut Allocator | &mut Random, &mut DirectP provides &HttpTransport from &mut HttpTransport, ProducerRequirements in Without<ProducerRequirements, &ByteDuplex>, ProducerRequirements in Without<ProducerRequirements, &HttpTransport>, CallbackRequirements in Without<CallbackRequirements, &ByteDuplex>, CallbackRequirements in Without<CallbackRequirements, &HttpTransport>, AcquisitionRequirements in Without<AcquisitionRequirements, &ByteDuplex>, AcquisitionRequirements in Without<AcquisitionRequirements, &HttpTransport>Follows an affine body producer through routed or direct acquisition.
Details
The producer is consumed for the first attempted body only. A redirect that retains the body
fails with ReplayUnavailable; a transition that drops the body continues with empty framing.
withReplayResponse
pub effect<'env> fn withReplayResponse<'client: 'env, 'uri: 'env, 'method: 'env, 'headers: 'env, 'policy: 'env, 'scratch: 'env, P, A, FactoryError, ProducerError, CallbackError, AcquisitionError, ?FactoryRequirements, ?ProducerRequirements, ?CallbackRequirements, ?AcquisitionRequirements, Producer, H: 'env, C: 'env, Factory: 'env, 'env>(client: &'client mut C, request: silk/http_redirect.Request<'uri, 'method, 'headers, 'policy>, policy: &'policy silk/http_redirect.Policy, factory: Factory, deadline: silk/option.Option<silk/system_clock.Instant>, scratch: &'scratch mut [u8], handler: H) -> A ! RedirectError | ValueError | FactoryError | ProducerError | CallbackError | ClientError | OutOfMemoryError | AcquisitionError ? FactoryRequirements | ProducerRequirements | CallbackRequirements | AcquisitionRequirements | &mut MonotonicClock | &mut Allocator | &mut Random where &mut P provides &HttpTransport from &mut HttpTransport | &mut MonotonicClock | &mut Allocator | &mut Random, &mut P provides &HttpTransport from &mut HttpTransport, &mut P provides &ByteDuplex from &mut ByteDuplex | &mut MonotonicClock | &mut Allocator | &mut Random, &mut P provides &ByteDuplex from &mut ByteDuplex, FactoryRequirements in Without<FactoryRequirements, &ByteDuplex>, FactoryRequirements in Without<FactoryRequirements, &HttpTransport>, ProducerRequirements in Without<ProducerRequirements, &ByteDuplex>, ProducerRequirements in Without<ProducerRequirements, &HttpTransport>, CallbackRequirements in Without<CallbackRequirements, &ByteDuplex>, CallbackRequirements in Without<CallbackRequirements, &HttpTransport>, AcquisitionRequirements in Without<AcquisitionRequirements, &ByteDuplex>, AcquisitionRequirements in Without<AcquisitionRequirements, &HttpTransport>Follows redirects by acquiring one fresh scoped producer for each retained-body attempt.
When to use
Use for replayable streams whose files, handles, or other resources require caller-owned factory bracketing.
Details
Each factory loan encloses selected-body provision and the complete attempt-client bracket. A dropped-body transition stops consulting the factory. Factory, producer, acquisition, and final callback channels remain direct members of this operation's unions.
withReplayHybridResponse
pub effect<'env> fn withReplayHybridResponse<'client: 'env, 'uri: 'env, 'method: 'env, 'headers: 'env, 'policy: 'env, 'scratch: 'env, RoutedP, DirectP, A, FactoryError, ProducerError, CallbackError, AcquisitionError, ?FactoryRequirements, ?ProducerRequirements, ?CallbackRequirements, ?AcquisitionRequirements, Producer, H: 'env, C: 'env, Factory: 'env, 'env>(client: &'client mut C, request: silk/http_redirect.Request<'uri, 'method, 'headers, 'policy>, policy: &'policy silk/http_redirect.Policy, factory: Factory, deadline: silk/option.Option<silk/system_clock.Instant>, scratch: &'scratch mut [u8], handler: H) -> A ! RedirectError | ValueError | FactoryError | ProducerError | CallbackError | ClientError | OutOfMemoryError | AcquisitionError ? FactoryRequirements | ProducerRequirements | CallbackRequirements | AcquisitionRequirements | &mut MonotonicClock | &mut Allocator | &mut Random where &mut RoutedP provides &HttpTransport from &mut HttpTransport | &mut MonotonicClock | &mut Allocator | &mut Random, &mut RoutedP provides &HttpTransport from &mut HttpTransport, &mut RoutedP provides &ByteDuplex from &mut ByteDuplex | &mut MonotonicClock | &mut Allocator | &mut Random, &mut RoutedP provides &ByteDuplex from &mut ByteDuplex, &mut DirectP provides &HttpTransport from &mut HttpTransport | &mut MonotonicClock | &mut Allocator | &mut Random, &mut DirectP provides &HttpTransport from &mut HttpTransport, FactoryRequirements in Without<FactoryRequirements, &ByteDuplex>, FactoryRequirements in Without<FactoryRequirements, &HttpTransport>, ProducerRequirements in Without<ProducerRequirements, &ByteDuplex>, ProducerRequirements in Without<ProducerRequirements, &HttpTransport>, CallbackRequirements in Without<CallbackRequirements, &ByteDuplex>, CallbackRequirements in Without<CallbackRequirements, &HttpTransport>, AcquisitionRequirements in Without<AcquisitionRequirements, &ByteDuplex>, AcquisitionRequirements in Without<AcquisitionRequirements, &HttpTransport>Follows replayable producer scopes through routed or direct acquisition.
Details
Each retained-body attempt receives one fresh producer inside the factory scope. A dropped-body transition stops factory acquisition. All source and acquisition channels remain direct.
writeBody
pub effect<'env> fn writeBody<'bytes: 'env, 'oneShot: 'env, 'replay: 'env, 'exchange: 'env, P: 'env, OneShotError, ReplayError, ?OneShotRequirements, ?ReplayRequirements, OneShot: 'env, ReplayProducer: 'env, 'life11: 'env, 'life12: 'env, 'life13: 'env, 'life14: 'env, 'life15: 'env, 'life16: 'env, 'env>(exchange: &'life11 mut silk/http_client.Exchange<'exchange, P>, current: &'life12 silk/uri.Uri<'life13>, expected: BodyMode, body: silk/http_redirect.AttemptBody<'bytes, 'oneShot, 'replay, OneShot, ReplayProducer>, scratch: &'life14 mut [u8], trailers: &'life15 silk/http_headers.Headers<'life16>, hop: usize) -> BodyWriteOutcome ! RedirectError | OneShotError | ReplayError | ClientError | OutOfMemoryError ? OneShotRequirements | ReplayRequirements | &mut MonotonicClock | &mut Allocator | &mut Random where &mut P provides &HttpTransport from &mut HttpTransport | &mut MonotonicClock | &mut Allocator | &mut RandomDrives one admitted attempt from prepared head through the first final response.
When to use
Use inside an attempt client's exchange callback after selecting one AttemptBody.
Details
The operation validates the selected and produced framing before sending the head. Require100
informational responses are consumed until 100 permits upload or a final response returns
EarlyFinal. Redirect bodies do not admit trailers, so non-empty trailers are rejected before
the head is sent. Produced chunks must fit scratch; known-length excess is rejected before it
can be written, and every completed upload finishes exactly once before receiving its final
head. Empty attempts never inspect or pull a producer. Locally created body-contract failures
copy the already bounded current URI into their owned redirect context.
Gotchas
scratch must be non-empty for KnownLength and Chunked bodies. A zero-length nonterminal pull
is a producer contract failure. An early final consumes the enclosing attempt's OneShot
authority even though this operation has not called pull.
StatusDecision
pub enum StatusDecisionWhether the current response is final or selects redirect transition processing.
Final
Final = 0Returns the current response without inspecting Location.
Redirect
Redirect = 1Applies redirect transition processing.
BodyDecision
pub enum BodyDecisionWhether the next attempt retains or drops the current body.
Retain
Retain = 0Retains framing and requires repeatability for a later attempt.
Drop
Drop = 1Drops the source and every content-associated field.
Transition
pub struct Transition<'method>A selected next method and body disposition.
Field method
pub method: silk/http.Method<'method>Exact next method, either preserved or the canonical GET/HEAD value.
Field body
pub body: BodyDecisionWhether content remains part of the next attempt.
Implementation Copy for silk/http_redirect.Transition<'method>
impl Copy for silk/http_redirect.Transition<'method>statusDecision
pub fn statusDecision<'life0>(policy: &'life0 silk/http_redirect.Policy, status: Status, followedHops: usize) -> silk/result.Result<silk/http_redirect.StatusDecision, silk/http_redirect.RedirectError>Classifies a response status without inspecting Location and enforces selected-hop capacity.
transition
pub fn transition<'method, 'life1>(policy: &'life1 silk/http_redirect.Policy, status: Status, method: silk/http.Method<'method>) -> silk/http_redirect.Transition<'method>Computes the exact RFC redirect method and body transition for a selected status.
resolveLocation
pub effect<'env> fn resolveLocation<'head: 'env, 'life1: 'env, 'life2: 'env, 'life3: 'env, 'env>(current: &'life1 silk/uri.Uri<'life2>, headers: &'life3 silk/http_headers.Headers<'head>, limits: HistoryLimits, hop: usize, status: Status) -> silk/result.Result<silk/uri.OwnedUri, silk/http_redirect.RedirectError> ! OutOfMemoryError ? &mut AllocatorReturns one independently owned HTTP or HTTPS URI from the selected response Location.
When to use
Use while the selected response head is live and before the next route is acquired.
Details
The operation requires exactly one field and copies it under maxUriBytes. It applies RFC 3986
resolution, rejects a resolved serialization above the same bound, and admits only HTTP or
HTTPS origins with a host, effective port, and no user information. It inherits the current
fragment only when the reference has no fragment.
Gotchas
A present empty fragment replaces the current fragment. The operation does not change current.
admitOrigin
pub fn admitOrigin<'life0, 'life1, 'life2>(policy: &'life0 silk/http_redirect.Policy, current: &'life1 silk/http_origin.Origin, next: &'life2 silk/http_origin.Origin, hop: usize, status: Status) -> silk/result.Result<bool, silk/http_redirect.RedirectError>Validates cross-origin and downgrade policy and reports whether sanitization is cross-origin.
History
pub struct HistoryBounded method-aware redirect-loop history in one preallocated byte arena.
Associated function History.make
pub effect<'static> fn make(limits: HistoryLimits) -> silk/result.Result<silk/http_redirect.History, silk/http_redirect.RedirectError> ! OutOfMemoryError ? &mut AllocatorChecks maxHops + 1 and reserves the complete history-byte budget before network I/O.
Details
All later inserts use one arena. An insert can fail its exact byte limit without another history allocation.
Method History.insert
pub effect<'env> fn insert<'method: 'env, 'life1: 'env, 'life2: 'env, 'life3: 'env, 'env>(self: &'life1 mut History, method: silk/http.Method<'method>, origin: Origin, uri: &'life2 silk/uri.Uri<'life3>) -> silk/result.Result<(), silk/http_redirect.RedirectError> ! OutOfMemoryError ? &mut AllocatorChecks and inserts one transformed method, normalized origin, and exact path/query key.
Method History.count
pub fn count<'life0>(self: &'life0 History) -> usizeReturns the number of stored method-aware keys.
Method History.ownedBytes
pub fn ownedBytes<'life0>(self: &'life0 History) -> usizeReturns the initialized bytes used by stored keys in the preallocated history arena.
sanitizeHeaders
pub effect<'env> fn sanitizeHeaders<'value: 'env, 'life1: 'env, 'life2: 'env, 'env>(headers: &'life1 silk/http_headers.Headers<'value>, policy: &'life2 silk/http_redirect.Policy, crossOrigin: bool, body: BodyDecision, limits: HeaderLimits) -> silk/result.Result<silk/http_headers.OwnedHeaders, silk/http.ValueError> ! OutOfMemoryError ? &mut AllocatorReturns independently owned fields after redirect-specific removal and cross-origin filtering.
When to use
Use before request preparation for each selected redirect attempt.
Details
The operation removes Host, Connection, Keep-Alive, TE, Trailer, Transfer-Encoding, Upgrade, Proxy-Connection, Proxy-Authorization, framing fields, Expect, and Connection-nominated fields. A dropped body also removes content metadata and digests. Cross-origin filtering retains only Accept, Accept-Encoding, Accept-Language, User-Agent, configured safe names, and retained-body content type, encoding, and language. Authorization, Cookie, Proxy-Authorization, Origin, Referer, and configured sensitive names are then denied with final precedence.
Gotchas
The result never contains Host, framing fields, Expect, or Proxy-Authorization. Request
preparation must generate those fields from the next origin, body mode, and selected route. An
invalid Connection token returns its original ValueError before output construction.