Skip to content

Commit

Permalink
unversioned mod for transport/resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
algesten committed Nov 26, 2024
1 parent f0c1881 commit 433cc84
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 11 deletions.
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,11 @@ mod send_body;
mod timings;
mod util;

pub mod unversioned;
use unversioned::resolver;
use unversioned::transport;

pub mod middleware;
pub mod resolver;
pub mod transport;

#[cfg(feature = "_tls")]
pub mod tls;
Expand Down
13 changes: 13 additions & 0 deletions src/unversioned/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//! API that does not (yet) follow semver.
//!
//! All public types under `unversioned` are available to use, but are not considered final
//! API in the semver sense. Breaking changes to anything under the module `unversioned`,
//! like `Transport` or `Resolver` will NOT be reflected in a major version bump of the
//! `ureq` crate. We do however commit to only make such changes in *minor* version bumps,
//! not patch.
//!
//! In time, we will move these types out of `unversioned` and solidify the API. There
//! is no set timeline for this.
pub mod resolver;
pub mod transport;
2 changes: 2 additions & 0 deletions src/resolver.rs → src/unversioned/resolver.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Name resolvers.
//!
//! **NOTE resolver does not (yet) [follow semver][super].**
//!
//! _NOTE: Resolver is deep configuration of ureq and is not required for regular use._
//!
//! Name resolving is pluggable. The resolver's duty is to take a URI and translate it
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/transport/io.rs → src/unversioned/transport/io.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::io;

use crate::transport::time::Duration;
use crate::Timeout;

use super::time::Duration;
use super::{NextTimeout, Transport};

/// Helper to turn a [`Transport`] into a std::io [`Read`](io::Read) and [`Write`](io::Write).
Expand Down
5 changes: 4 additions & 1 deletion src/transport/mod.rs → src/unversioned/transport/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! HTTP/1.1 data transport.
//!
//! **NOTE: transport does not (yet) [follow semver][super].**
//!
//! _NOTE: Transport is deep configuration of ureq and is not required for regular use._
//!
//! ureq provides a pluggable transport layer making it possible to write bespoke
Expand Down Expand Up @@ -29,9 +31,10 @@ use http::Uri;
use crate::config::Config;
use crate::http;
use crate::proxy::Proto;
use crate::resolver::{ResolvedSocketAddrs, Resolver};
use crate::Error;

use super::resolver::{ResolvedSocketAddrs, Resolver};

pub use self::tcp::TcpConnector;
use self::time::Instant;

Expand Down
8 changes: 4 additions & 4 deletions src/transport/socks.rs → src/unversioned/transport/socks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ use std::{io, thread};
use socks::{Socks4Stream, Socks5Stream};

use crate::proxy::{Proto, Proxy};
use crate::resolver::ResolvedSocketAddrs;
use crate::transport::tcp::TcpTransport;
use crate::transport::LazyBuffers;
use crate::Error;

use super::{ConnectionDetails, Connector, NextTimeout, Transport};
use super::ResolvedSocketAddrs;

use super::tcp::TcpTransport;
use super::{ConnectionDetails, Connector, LazyBuffers, NextTimeout, Transport};

/// Connector for SOCKS proxies.
///
Expand Down
5 changes: 3 additions & 2 deletions src/transport/tcp.rs → src/unversioned/transport/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ use std::net::{SocketAddr, TcpStream};
use std::{fmt, io, time};

use crate::config::Config;
use crate::resolver::ResolvedSocketAddrs;
use crate::transport::time::Duration;
use crate::util::IoResultExt;
use crate::Error;

use super::ResolvedSocketAddrs;

use super::time::Duration;
use super::{Buffers, ConnectionDetails, Connector, LazyBuffers, NextTimeout, Transport};

#[derive(Default)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ use std::{fmt, io, thread};
use http::{Method, Request, Uri};

use crate::http;
use crate::transport::time::Duration;
use crate::Error;

use super::time::Duration;
use super::{Buffers, ConnectionDetails, Connector, LazyBuffers, NextTimeout, Transport};

#[derive(Default)]
Expand Down
File renamed without changes.

0 comments on commit 433cc84

Please sign in to comment.