Skip to content

Commit

Permalink
refactor(iroh-net)!: Rename MagicEndpoint -> Endpoint (#2287)
Browse files Browse the repository at this point in the history
## Description

This renames the MagicEndpoint (and it's builder) into Endpoint.
Hopefully providing a more consistent API.

## Breaking Changes

- iroh_net::magic_endpoint -> iroh_net::endpoint
- iroh_net::magic_endpoint::MagicEndpoint ->
iroh_net::endpoint::Endpoint
- iroh_net::magic_endpoint::MagicEndpointBuilder ->
iroh_net::endpoint::Builder
- iroh::node::Node::magic_endpoint -> iroh::node::Node::endpoint

## Notes & open questions

<!-- Any notes, remarks or open questions you have to make about the PR.
-->

## Change checklist

- [x] Self-review.
- [x] Documentation updates if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.
  • Loading branch information
flub authored May 13, 2024
1 parent b8dd924 commit 86e7c07
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{
time::{Duration, Instant},
};

use iroh_net::{key::PublicKey, magic_endpoint::get_remote_node_id, MagicEndpoint, NodeAddr};
use iroh_net::{endpoint::get_remote_node_id, key::PublicKey, Endpoint, NodeAddr};
use serde::{Deserialize, Serialize};
use tracing::{debug, error_span, trace, Instrument};

Expand All @@ -27,7 +27,7 @@ mod codec;

/// Connect to a peer and sync a replica
pub async fn connect_and_sync(
endpoint: &MagicEndpoint,
endpoint: &Endpoint,
sync: &SyncHandle,
namespace: NamespaceId,
peer: NodeAddr,
Expand Down Expand Up @@ -106,7 +106,7 @@ pub enum AcceptOutcome {
/// Handle an iroh-docs connection and sync all shared documents in the replica store.
pub async fn handle_connection<F, Fut>(
sync: SyncHandle,
connecting: iroh_net::magic_endpoint::Connecting,
connecting: iroh_net::endpoint::Connecting,
accept_cb: F,
) -> Result<SyncFinished, AcceptError>
where
Expand Down

0 comments on commit 86e7c07

Please sign in to comment.