-
Notifications
You must be signed in to change notification settings - Fork 0
phase 13a: feature-flag detangle (client side) #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -29,30 +29,42 @@ | |||||||||||||||||
| //! (either a `static` or a heap allocator); the capacity constants plus | ||||||||||||||||||
| //! [`crate::UDP_BUFFER_SIZE`] are the knobs for trimming this footprint. | ||||||||||||||||||
| mod error; | ||||||||||||||||||
| #[cfg(feature = "client-tokio")] | ||||||||||||||||||
| mod inner; | ||||||||||||||||||
| #[cfg(feature = "client-tokio")] | ||||||||||||||||||
| mod service_registry; | ||||||||||||||||||
| #[cfg(feature = "client-tokio")] | ||||||||||||||||||
| mod session; | ||||||||||||||||||
| #[cfg(feature = "client-tokio")] | ||||||||||||||||||
| mod socket_manager; | ||||||||||||||||||
|
|
||||||||||||||||||
| pub use error::Error; | ||||||||||||||||||
|
|
||||||||||||||||||
| #[cfg(feature = "client-tokio")] | ||||||||||||||||||
| use crate::Timer; | ||||||||||||||||||
| use crate::e2e::{E2ECheckStatus, E2EKey, E2EProfile, E2ERegistry}; | ||||||||||||||||||
| use crate::e2e::E2ECheckStatus; | ||||||||||||||||||
| #[cfg(feature = "client-tokio")] | ||||||||||||||||||
| use crate::e2e::{E2EKey, E2EProfile, E2ERegistry}; | ||||||||||||||||||
| #[cfg(feature = "client-tokio")] | ||||||||||||||||||
| use crate::tokio_transport::{TokioChannels, TokioSpawner, TokioTimer}; | ||||||||||||||||||
| use crate::transport::{ | ||||||||||||||||||
| ChannelFactory, E2ERegistryHandle, InterfaceHandle, MpscSend, OneshotRecv, Spawner, | ||||||||||||||||||
| UnboundedRecv, | ||||||||||||||||||
| }; | ||||||||||||||||||
| use crate::transport::{ChannelFactory, OneshotRecv, UnboundedRecv}; | ||||||||||||||||||
| #[cfg(feature = "client-tokio")] | ||||||||||||||||||
| use crate::transport::{E2ERegistryHandle, InterfaceHandle, MpscSend, Spawner}; | ||||||||||||||||||
| use crate::{protocol, protocol::Message, traits::PayloadWireFormat}; | ||||||||||||||||||
| #[cfg(feature = "client-tokio")] | ||||||||||||||||||
| use inner::{ControlMessage, Inner}; | ||||||||||||||||||
| use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4}; | ||||||||||||||||||
| use std::net::SocketAddr; | ||||||||||||||||||
| #[cfg(feature = "client-tokio")] | ||||||||||||||||||
| use std::net::{Ipv4Addr, SocketAddrV4}; | ||||||||||||||||||
| #[cfg(feature = "client-tokio")] | ||||||||||||||||||
| use std::sync::{Arc, Mutex, RwLock}; | ||||||||||||||||||
| #[cfg(feature = "client-tokio")] | ||||||||||||||||||
| use tracing::info; | ||||||||||||||||||
|
|
||||||||||||||||||
| /// Handle to a pending SOME/IP request-response transaction. | ||||||||||||||||||
| /// Resolves when the inner loop receives a matching unicast reply. | ||||||||||||||||||
| /// Does not borrow `Client`. | ||||||||||||||||||
| pub struct PendingResponse<P: Send + 'static, C: ChannelFactory = TokioChannels> { | ||||||||||||||||||
| pub struct PendingResponse<P: Send + 'static, C: ChannelFactory> { | ||||||||||||||||||
| receiver: C::OneshotReceiver<Result<P, Error>>, | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -144,7 +156,7 @@ impl<P: PayloadWireFormat> std::fmt::Debug for ClientUpdate<P> { | |||||||||||||||||
| /// | ||||||||||||||||||
| /// Returned by [`Client::new`]. Call [`recv`](Self::recv) to receive | ||||||||||||||||||
| /// discovery, unicast, and error updates. | ||||||||||||||||||
| pub struct ClientUpdates<MessageDefinitions: PayloadWireFormat + 'static, C: ChannelFactory = TokioChannels> { | ||||||||||||||||||
| pub struct ClientUpdates<MessageDefinitions: PayloadWireFormat + 'static, C: ChannelFactory> { | ||||||||||||||||||
| update_receiver: C::UnboundedReceiver<ClientUpdate<MessageDefinitions>>, | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -178,18 +190,20 @@ impl<MessageDefinitions: PayloadWireFormat + 'static, C: ChannelFactory> ClientU | |||||||||||||||||
| /// (`Arc<Mutex<E2ERegistry>>` and `Arc<RwLock<Ipv4Addr>>`) are used by the | ||||||||||||||||||
| /// standard constructors [`Self::new`] / [`Self::new_with_loopback`] / | ||||||||||||||||||
| /// [`Self::new_with_spawner_and_loopback`]. | ||||||||||||||||||
| #[cfg(feature = "client-tokio")] | ||||||||||||||||||
| #[derive(Clone)] | ||||||||||||||||||
| pub struct Client< | ||||||||||||||||||
| MessageDefinitions: PayloadWireFormat + Send + 'static, | ||||||||||||||||||
| R: E2ERegistryHandle = Arc<Mutex<E2ERegistry>>, | ||||||||||||||||||
| I: InterfaceHandle = Arc<RwLock<Ipv4Addr>>, | ||||||||||||||||||
| C: ChannelFactory = TokioChannels, | ||||||||||||||||||
| R: E2ERegistryHandle, | ||||||||||||||||||
| I: InterfaceHandle, | ||||||||||||||||||
| C: ChannelFactory, | ||||||||||||||||||
| > { | ||||||||||||||||||
| interface: I, | ||||||||||||||||||
| control_sender: C::BoundedSender<inner::ControlMessage<MessageDefinitions, C>>, | ||||||||||||||||||
| e2e_registry: R, | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| #[cfg(feature = "client-tokio")] | ||||||||||||||||||
| impl<MessageDefinitions, R, I, C> std::fmt::Debug for Client<MessageDefinitions, R, I, C> | ||||||||||||||||||
| where | ||||||||||||||||||
| MessageDefinitions: PayloadWireFormat + Send + 'static, | ||||||||||||||||||
|
|
@@ -204,7 +218,13 @@ where | |||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| /// Constructors that create the default `Arc`-backed handles for `std + tokio`. | ||||||||||||||||||
| /// Convenience constructors that default to `Arc<Mutex<_>>` / `Arc<RwLock<_>>` | ||||||||||||||||||
| /// handles, the `TokioChannels` channel factory, and the `TokioSpawner` task | ||||||||||||||||||
| /// submitter. Available under the `client-tokio` feature, which pulls in | ||||||||||||||||||
| /// `tokio` + `socket2`. Bare-metal callers use | ||||||||||||||||||
| /// [`Self::new_with_spawner_and_loopback`] (always available under `client`) | ||||||||||||||||||
| /// and supply their own channel factory + spawner. | ||||||||||||||||||
|
Comment on lines
+224
to
+226
|
||||||||||||||||||
| /// `tokio` + `socket2`. Bare-metal callers use | |
| /// [`Self::new_with_spawner_and_loopback`] (always available under `client`) | |
| /// and supply their own channel factory + spawner. | |
| /// `tokio` + `socket2`. | |
| /// | |
| /// Bare-metal / non-`tokio` integrations should use the `transport` trait | |
| /// surface directly today; this `Client` type and its constructors are gated | |
| /// on `client-tokio`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that
clientisstd + futuresandclient-tokiolayers tokio/socket2 on top, the bare-metal feature docs later in this section (notably the statement thatEmbassySyncChannelsis available without tokio) don’t match the current module gating (EmbassySyncChannelsstill lives undertokio_transport). Please reconcile this: either move/re-export the embassy channel backend forbare_metalbuilds, or update the feature docs to reflect its actual availability.