Skip to content

Commit

Permalink
Add Debug and accessors on ConnectOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
aecsocket committed Sep 23, 2024
1 parent 899e901 commit cd7e0d0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions wtransport/src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ impl Endpoint<endpoint_side::Client> {
/// # Ok(())
/// # }
/// ```
#[derive(Debug, Clone)]
pub struct ConnectOptions {
url: String,
additional_headers: HashMap<String, String>,
Expand All @@ -490,6 +491,16 @@ impl ConnectOptions {
additional_headers: Default::default(),
}
}

/// Gets the URL which this will connect to.
pub fn url(&self) -> &str {
&self.url
}

/// Gets the additional headers that will be passed when connecting.
pub fn additional_headers(&self) -> &HashMap<String, String> {
&self.additional_headers
}
}

/// A trait for converting types into `ConnectOptions`.
Expand Down

0 comments on commit cd7e0d0

Please sign in to comment.