silk/http_client_native
Profiles: aarch64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, x86_64-unknown-linux-gnu-no-libc.
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 NativeTransportThe unavailable native transport type for an unsupported target.
Method NativeTransport.route
pub fn route<'life0>(self: &'life0 NativeTransport) -> NativeRouteReturns empty route metadata; this target cannot acquire a native connection.
NativeRouteProvider
pub struct NativeRouteProviderThe unavailable routed native provider type for an unsupported target.
Implementation HttpTransport for NativeTransport
impl HttpTransport for NativeTransportOperation readSomeRaw
readSomeRaw = NativeTransport.impl@1.readSomeRawRejects reads because this target has no native connection.
Operation writeSomeRaw
writeSomeRaw = NativeTransport.impl@1.writeSomeRawRejects writes because this target has no native connection.
Operation flush
flush = NativeTransport.impl@1.flushRejects flushing because this target has no native connection.
Operation close
close = NativeTransport.impl@1.closeCompletes locally because no native resource exists.
Implementation HttpTransport for NativeRouteProvider
impl HttpTransport for NativeRouteProviderOperation readSomeRaw
readSomeRaw = NativeRouteProvider.impl@2.readSomeRawRejects reads because this target has no native connection.
Operation writeSomeRaw
writeSomeRaw = NativeRouteProvider.impl@2.writeSomeRawRejects writes because this target has no native connection.
Operation flush
flush = NativeRouteProvider.impl@2.flushRejects flushing because this target has no native connection.
Operation close
close = NativeRouteProvider.impl@2.closeCompletes locally because no native resource exists.
Implementation ByteDuplex for NativeRouteProvider
impl ByteDuplex for NativeRouteProviderOperation readSomeRaw
readSomeRaw = NativeRouteProvider.impl@3.readSomeRawRejects reads because this target has no native connection.
Operation writeSomeRaw
writeSomeRaw = NativeRouteProvider.impl@3.writeSomeRawRejects writes because this target has no native connection.
Operation flushRaw
flushRaw = NativeRouteProvider.impl@3.flushRawRejects flushing because this target has no native connection.
Operation shutdownWriteRaw
shutdownWriteRaw = NativeRouteProvider.impl@3.shutdownWriteRawRejects write shutdown because this target has no native connection.
Operation closeRaw
closeRaw = NativeRouteProvider.impl@3.closeRawCompletes locally because no native resource exists.
preflight
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>Returns the typed unsupported-target result before allocation or provider 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 unsupported-target before route inspection or provider dispatch.
acquireOwned
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> ! NativeClientErrorRejects owned native HTTP acquisition before inspecting inputs on this target.
admitUnixRoute
pub effect<'life0> fn admitUnixRoute<'life0>(path: &'life0 [u8]) -> NativeRoute ! NativeClientErrorRejects Unix route admission before inspecting the path on an unsupported target.
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> ! NativeClientErrorRejects owned Unix HTTP acquisition before inspecting inputs on this target.
withConnection
pub effect<'env> fn withConnection<A, E, ?R, H: 'env, 'env>(origin: Origin, options: Options, limits: Limits, handler: H) -> A ! E | NativeClientError ? RRejects native HTTP acquisition before allocation or provider dispatch on this target.
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 | NativeClientError ? RRejects Unix HTTP acquisition before allocation or provider dispatch on this target.
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 | NativeClientError ? R where R in Without<R, &ByteDuplex>, R in Without<R, &HttpTransport>Rejects routed native acquisition before allocation or provider dispatch on this target.
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/http_client_native.NativeClientError, ? , ? 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/http_client_native.NativeClientError, ? , ? HandlerRequirements> for silk/http_client_native.NativeRedirectClient<'configuration, 'policy, A, HandlerError, ? HandlerRequirements>Operation withAttempt
withAttempt = NativeRedirectClient.withAttemptUnsupportedroute
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.