Skip to content

Commit 40f8eec

Browse files
committed
transit: Make TransitConnector crate-public
1 parent ff57cc4 commit 40f8eec

File tree

1 file changed

+3
-26
lines changed

1 file changed

+3
-26
lines changed

src/transit.rs

+3-26
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const PUBLIC_STUN_SERVER: &str = "stun.piegames.de:3478";
5151
note = "This will be a private type in the future. Open an issue if you require access to protocol intrinsics in the future"
5252
)]
5353
#[derive(Debug)]
54-
pub struct TransitKey;
54+
pub(crate) struct TransitKey;
5555

5656
#[expect(deprecated)]
5757
impl KeyPurpose for TransitKey {}
@@ -785,7 +785,7 @@ pub fn log_transit_connection(
785785
note = "This will be a private type in the future. Open an issue if you require access to protocol intrinsics in the future"
786786
)]
787787
#[expect(deprecated)]
788-
pub async fn init(
788+
pub(crate) async fn init(
789789
mut abilities: Abilities,
790790
peer_abilities: Option<Abilities>,
791791
relay_hints: Vec<RelayHint>,
@@ -931,7 +931,7 @@ impl MaybeConnectedSocket {
931931
since = "0.7.0",
932932
note = "This will be a private type in the future. Open an issue if you require access to protocol intrinsics in the future"
933933
)]
934-
pub struct TransitConnector {
934+
pub(crate) struct TransitConnector {
935935
/* Only `Some` if direct-tcp-v1 ability has been enabled.
936936
* The first socket is the port from which we will start connection attempts.
937937
* For in case the user is behind no firewalls, we must also listen to the second socket.
@@ -954,29 +954,6 @@ impl TransitConnector {
954954
&self.our_hints
955955
}
956956

957-
/**
958-
* Forwards to either [`leader_connect`](Self::leader_connect) or [`follower_connect`](Self::follower_connect).
959-
*
960-
* It usually is better to call the respective functions directly by their name, as it makes
961-
* them less easy to confuse (confusion may still happen though). Nevertheless, sometimes it
962-
* is desirable to use the same code for both sides and only track the side with a boolean.
963-
*/
964-
pub async fn connect(
965-
self,
966-
is_leader: bool,
967-
transit_key: Key<TransitKey>,
968-
their_abilities: Abilities,
969-
their_hints: Arc<Hints>,
970-
) -> Result<(Transit, TransitInfo), TransitConnectError> {
971-
if is_leader {
972-
self.leader_connect(transit_key, their_abilities, their_hints)
973-
.await
974-
} else {
975-
self.follower_connect(transit_key, their_abilities, their_hints)
976-
.await
977-
}
978-
}
979-
980957
/**
981958
* Connect to the other side, as sender.
982959
*/

0 commit comments

Comments
 (0)