silk/http_client_native
Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, x86_64-unknown-linux-gnu.
Native connection acquisition for one HTTP origin and one serial client scope.
Details
HTTPS authenticates the original origin with explicit trust. Absolute deadlines are unchanged through resolution, connection, and TLS authentication. Synchronous hostname resolution rejects an overall deadline before dispatch. Cleanup closes without a flush or TLS shutdown.
Import as HttpClientNative with import silk.http_client_native as HttpClientNative.
Public declarations: 16.
NativeRoute
pub struct NativeRouteThe immutable transport route retained independently of the HTTP origin.
Method NativeRoute.isUnix
pub fn isUnix<'life0>(self: &'life0 NativeRoute) -> boolReturns whether this route uses an explicit Unix socket path.
Method NativeRoute.path
pub fn path<'a>(self: &'a NativeRoute) -> &'a [u8]Borrows the exact owned Unix path, or an empty slice for direct TCP.
Implementation Copy for NativeRoute
impl Copy for NativeRouteNativeClientError
pub union NativeClientErrorA native HTTP acquisition capability or option admission failure.
UnsupportedTarget
NativeClientError.UnsupportedTarget: NativeClientErrorThe selected target has no native HTTP acquisition implementation.
InvalidConnectOptions
NativeClientError.InvalidConnectOptions: NativeClientErrorThe native polling interval or attempt count is outside its finite accepted range.
UnsupportedDeadline
NativeClientError.UnsupportedDeadline: NativeClientErrorSynchronous hostname resolution cannot honor the supplied overall deadline.
TrustRequired
NativeClientError.TrustRequired: NativeClientErrorHTTPS owned acquisition requires one caller-prepared frozen trust snapshot.
AlpnMismatch
NativeClientError.AlpnMismatch { error: ConnectionError }: NativeClientErrorRequired HTTP/1.1 application protocol negotiation did not succeed.
Field error
pub error: ConnectionErrorThe complete TLS connection failure.
AlpnPolicy
pub enum AlpnPolicyThe HTTP version policy for TLS application protocol negotiation.
OptionalHttp11
OptionalHttp11 = 0Offers only http/1.1 and permits an absent selection.
RequiredHttp11
RequiredHttp11 = 1Requires the peer to select http/1.1.
Http10
Http10 = 2Sends no ALPN extension for an HTTP/1.0-only peer.
Options
pub struct OptionsFinite native acquisition and TLS authentication limits.
Field maximumAddresses
pub maximumAddresses: usizeMaximum number of resolved numeric addresses.
Field family
pub family: FamilySelectionAddress family admitted by resolution.
Field noDelay
pub noDelay: boolWhether the socket disables Nagle's algorithm.
Field pollIntervalNanoseconds
pub pollIntervalNanoseconds: u64Native readiness polling interval in nanoseconds.
Field maximumAttempts
pub maximumAttempts: usizeMaximum native connection attempts.
Field deadline
pub deadline: silk/option.Option<silk/system_clock.Instant>Absolute overall deadline on the active monotonic timeline.
Field handshakeNanoseconds
pub handshakeNanoseconds: u64Maximum TLS authentication duration in nanoseconds.
Field tls
pub tls: ClientLimitsTLS protocol storage limits.
Field trust
pub trust: TrustLoadLimitsExplicit trust source load bounds.
Field alpn
pub alpn: AlpnPolicyHTTP-only application protocol negotiation policy.
Associated function Options.defaults
pub fn defaults() -> OptionsReturns finite defaults with no overall deadline and optional HTTP/1.1 negotiation.
NativeTransport
pub struct NativeTransportOne affine native HTTP transport that owns its exact socket or TLS connection.
Method NativeTransport.route
pub fn route<'life0>(self: &'life0 NativeTransport) -> NativeRouteReturns owned immutable route metadata while leaving the transport exclusively inside its session.
NativeRouteProvider
pub struct NativeRouteProviderOne affine plain native provider owned by a routed HTTP scope.
Details
The provider retains the exact socket selected for the route's physical peer. HTTP and raw byte authority share one terminal state so CONNECT transfer cannot duplicate ownership.
Implementation HttpTransport for NativeRouteProvider
impl HttpTransport for NativeRouteProviderOperation readSomeRaw
readSomeRaw = NativeRouteProvider.readHttpOperation writeSomeRaw
writeSomeRaw = NativeRouteProvider.writeHttpOperation flush
flush = NativeRouteProvider.flushHttpOperation close
close = NativeRouteProvider.closeHttpImplementation ByteDuplex for NativeRouteProvider
impl ByteDuplex for NativeRouteProviderOperation readSomeRaw
readSomeRaw = NativeRouteProvider.readBytesOperation writeSomeRaw
writeSomeRaw = NativeRouteProvider.writeBytesOperation flushRaw
flushRaw = NativeRouteProvider.flushBytesOperation shutdownWriteRaw
shutdownWriteRaw = NativeRouteProvider.shutdownBytesOperation closeRaw
closeRaw = NativeRouteProvider.closeBytesacquireOwned
pub effect<'static> fn acquireOwned(origin: Origin, options: Options, limits: Limits, preparedTrust: silk/option.Option<silk/trust_snapshot.TrustSnapshot>, acquisitionDeadline: silk/option.Option<silk/system_clock.Instant>) -> silk/http_client.Connection<silk/http_client_native.NativeTransport> ! NativeClientError | ClientError | ResolverError | NativeSocketError | ConnectionError | IdentityError | OutOfMemoryError ? &mut Allocator | &mut MonotonicClock | &mut SystemClock | &mut RandomAcquires and publishes one complete direct TCP or HTTPS HTTP connection owner.
Details
acquisitionDeadline can only shorten options.deadline. HTTPS consumes one caller-prepared
frozen trust snapshot and authenticates the exact original origin. The returned HTTP owner
retains no acquisition or request deadline; callers must close it or transfer it into another
scoped owner.
admitUnixRoute
pub effect<'life0> fn admitUnixRoute<'life0>(path: &'life0 [u8]) -> NativeRoute ! NativeSocketErrorCopies one Unix path into bounded native route metadata before transport contact.
Details
The target-specific native address capacity is checked before the returned route is published.
acquireUnixOwned
pub effect<'life0> fn acquireUnixOwned<'life0>(path: &'life0 [u8], origin: Origin, options: Options, limits: Limits, preparedTrust: silk/option.Option<silk/trust_snapshot.TrustSnapshot>, acquisitionDeadline: silk/option.Option<silk/system_clock.Instant>) -> silk/http_client.Connection<silk/http_client_native.NativeTransport> ! NativeClientError | ClientError | NativeSocketError | ConnectionError | IdentityError | OutOfMemoryError ? &mut Allocator | &mut MonotonicClock | &mut SystemClock | &mut RandomAcquires and publishes one complete Unix-routed HTTP or HTTPS connection owner.
Details
The Unix path selects only the physical transport. TLS still authenticates origin, and the
returned HTTP owner retains neither the acquisition nor request deadline.
withConnection
pub effect<'env> fn withConnection<A, E, ?R, H: 'env, 'env>(origin: Origin, options: Options, limits: Limits, handler: H) -> A ! E | ClientError | NativeClientError | ResolverError | NativeSocketError | ConnectionError | IdentityError | TrustSourceError | OutOfMemoryError ? R | &mut Allocator | &mut MonotonicClock | &mut SystemClock | &mut Random | &mut TrustSource where R in Without<R, &HttpTransport>Resolves and acquires one origin, then lends its serial HTTP connection to one handler.
Details
HTTPS freezes trust before opening and authenticates the original origin. Host fields never
replace that identity. Http10 disables ALPN; other policies offer only HTTP/1.1.
withUnixConnection
pub effect<'env> fn withUnixConnection<A, E, ?R, H: 'env, 'life4: 'env, 'env>(path: &'life4 [u8], origin: Origin, options: Options, limits: Limits, handler: H) -> A ! E | ClientError | NativeClientError | NativeSocketError | ConnectionError | IdentityError | TrustSourceError | OutOfMemoryError ? R | &mut Allocator | &mut MonotonicClock | &mut SystemClock | &mut Random | &mut TrustSource where R in Without<R, &HttpTransport>Connects an explicit Unix socket while retaining a separate HTTP and TLS authority.
Details
The socket path selects only the transport. HTTPS authenticates origin with explicit trust.
withProxyRoute
pub effect<'env> fn withProxyRoute<'configuration: 'env, A, E, ?R, H: 'env, 'env>(route: silk/http_proxy.Route<'configuration>, options: Options, limits: Limits, preparedTrust: silk/option.Option<silk/trust_snapshot.TrustSnapshot>, handler: H) -> A ! E | ProxyError | ClientError | NativeClientError | ResolverError | NativeSocketError | ConnectionError | IdentityError | OutOfMemoryError ? R | &mut Allocator | &mut MonotonicClock | &mut SystemClock | &mut Random where R in Without<R, &ByteDuplex>, R in Without<R, &HttpTransport>Resolves and connects only one sealed route's physical peer, then lends the final HTTP scope.
Details
options.deadline is passed unchanged through native preflight, resolution, connection,
CONNECT, and TLS. limits supplies both the HTTP scope and generated CONNECT bounds. Secure
routes consume caller-prepared trust; no resolver fallback or alternate endpoint is selected.
Implementation HttpTransport for NativeTransport
impl HttpTransport for NativeTransportOperation readSomeRaw
readSomeRaw = NativeTransport.readOperation writeSomeRaw
writeSomeRaw = NativeTransport.writeOperation flush
flush = NativeTransport.flushOutputOperation close
close = NativeTransport.closeLeasepreflight
pub fn preflight<'life0, 'life1>(origin: &'life0 silk/http_origin.Origin, options: &'life1 silk/http_client_native.Options) -> silk/result.Result<(), silk/http_client_native.NativeClientError>Checks native TCP support and rejects a hostname deadline before resolver dispatch.
preflightProxyRoute
pub fn preflightProxyRoute<'configuration, 'life1, 'life2>(route: &'life1 silk/http_proxy.Route<'configuration>, options: &'life2 silk/http_client_native.Options) -> silk/result.Result<silk/http_origin.Origin, silk/http_client_native.NativeClientError | silk/http_proxy.ProxyError>Returns the exact route-selected native peer after target and deadline preflight.
Details
Direct returns the original origin; Forward and Tunnel return the sealed plain proxy origin. A finite deadline with either selected domain fails before synchronous resolver dispatch.
NativeRedirectClient
pub struct NativeRedirectClient<'configuration, 'policy, A, HandlerError, ?HandlerRequirements>Rebuildable native route acquisition for bounded redirect operations.
Details
The initial sealed route retains the immutable proxy configuration. On supported native
targets, every attempt recomputes policy for its current URI, completes method, target, header,
and native-route preflight before destination contact, and replaces the stored option deadline
with the operation's unchanged absolute deadline. Secure attempts load a fresh trust snapshot
before acquisition; tunneled TLS continues to authenticate the original origin through
withProxyRoute. Other targets fail with UnsupportedTarget before inspecting the request.
Associated function NativeRedirectClient.make
pub fn make<'configuration, 'policy, A, HandlerError, ?HandlerRequirements>(route: silk/http_proxy.Route<'configuration>, options: Options, limits: Limits) -> silk/http_client_native.NativeRedirectClient<'configuration, 'policy, A, HandlerError, ? HandlerRequirements>Creates a reusable redirect attempt client from one policy-selected route.
Implementation silk/http_redirect.AttemptClient<'policy, silk/http_client_native.NativeRouteProvider, A, HandlerError, silk/allocator.OutOfMemoryError | silk/http.ValueError | silk/http_client.ClientError | silk/http_client_native.NativeClientError | silk/http_origin.OriginError | silk/http_proxy.ProxyError | silk/http_request.RequestError | silk/https_identity.IdentityError | silk/native_socket.NativeSocketError | silk/resolver.ResolverError | silk/tls_connection.ConnectionError | silk/trust_snapshot.TrustSourceError, ? &mut silk/allocator.Allocator | &mut silk/monotonic_clock.MonotonicClock | &mut silk/random.Random | &mut silk/system_clock.SystemClock | &mut silk/trust_source.TrustSource, ? HandlerRequirements> for silk/http_client_native.NativeRedirectClient<'configuration, 'policy, A, HandlerError, ? HandlerRequirements>
impl silk/http_redirect.AttemptClient<'policy, silk/http_client_native.NativeRouteProvider, A, HandlerError, silk/allocator.OutOfMemoryError | silk/http.ValueError | silk/http_client.ClientError | silk/http_client_native.NativeClientError | silk/http_origin.OriginError | silk/http_proxy.ProxyError | silk/http_request.RequestError | silk/https_identity.IdentityError | silk/native_socket.NativeSocketError | silk/resolver.ResolverError | silk/tls_connection.ConnectionError | silk/trust_snapshot.TrustSourceError, ? &mut silk/allocator.Allocator | &mut silk/monotonic_clock.MonotonicClock | &mut silk/random.Random | &mut silk/system_clock.SystemClock | &mut silk/trust_source.TrustSource, ? HandlerRequirements> for silk/http_client_native.NativeRedirectClient<'configuration, 'policy, A, HandlerError, ? HandlerRequirements>Operation withAttempt
withAttempt = NativeRedirectClient.withAttemptroute
pub fn route<'life0>(connection: &'life0 silk/http_client.Connection<silk/http_client_native.NativeTransport>) -> NativeRouteReturns immutable native route metadata from an owned HTTP session without lending its transport mutably.