Skip to content

Commit 3a79c53

Browse files
committed
feat: update dependencies and remove alloc feature checks across the codebase
1 parent 6ea9573 commit 3a79c53

15 files changed

Lines changed: 15 additions & 40 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,14 @@ examples:
277277
@printf "$(GREEN)Building all example projects...$(NC)\n"
278278
@printf "$(YELLOW) → Building sync-api-demo (synchronous API wrapper)$(NC)\n"
279279
cargo build --package sync-api-demo
280+
@printf "$(YELLOW) → Building mqtt-connector-demo-common (shared MQTT demo code, runtime-agnostic)$(NC)\n"
281+
cargo build --package mqtt-connector-demo-common
280282
@printf "$(YELLOW) → Building tokio-mqtt-connector-demo (native, tokio runtime)$(NC)\n"
281283
cargo build --package tokio-mqtt-connector-demo
282284
@printf "$(YELLOW) → Building embassy-mqtt-connector-demo (embedded, embassy runtime)$(NC)\n"
283285
cargo build --package embassy-mqtt-connector-demo --target thumbv7em-none-eabihf
286+
@printf "$(YELLOW) → Building knx-connector-demo-common (shared KNX demo code, runtime-agnostic)$(NC)\n"
287+
cargo build --package knx-connector-demo-common
284288
@printf "$(YELLOW) → Building tokio-knx-connector-demo (native, tokio runtime)$(NC)\n"
285289
cargo build --package tokio-knx-connector-demo
286290
@printf "$(YELLOW) → Building embassy-knx-connector-demo (embedded, embassy runtime)$(NC)\n"

aimdb-core/src/builder.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use hashbrown::HashMap;
1515
#[cfg(not(feature = "std"))]
1616
use alloc::{boxed::Box, sync::Arc};
1717

18-
#[cfg(all(not(feature = "std"), feature = "alloc"))]
18+
#[cfg(not(feature = "std"))]
1919
use alloc::string::{String, ToString};
2020

2121
#[cfg(feature = "std")]
@@ -54,7 +54,6 @@ use crate::{DbError, DbResult};
5454
/// - `SerializerKind` - User-provided serializer for the record type (raw or context-aware)
5555
/// - `Vec<(String, String)>` - Configuration options from the URL query
5656
/// - `Option<TopicProviderFn>` - Optional dynamic topic provider
57-
#[cfg(feature = "alloc")]
5857
pub type OutboundRoute = (
5958
String,
6059
Box<dyn crate::connector::ConsumerTrait>,
@@ -579,7 +578,6 @@ where
579578
let mut reg = RecordRegistrar {
580579
rec,
581580
connector_builders: &self.connector_builders,
582-
#[cfg(feature = "alloc")]
583581
record_key: record_key.as_str().to_string(),
584582
extensions: &self.extensions,
585583
last_stage: None,
@@ -1499,7 +1497,6 @@ impl<R: aimdb_executor::RuntimeAdapter + 'static> AimDb<R> {
14991497
/// let router = RouterBuilder::from_routes(routes).build();
15001498
/// connector.set_router(router).await?;
15011499
/// ```
1502-
#[cfg(feature = "alloc")]
15031500
pub fn collect_inbound_routes(
15041501
&self,
15051502
scheme: &str,
@@ -1577,7 +1574,6 @@ impl<R: aimdb_executor::RuntimeAdapter + 'static> AimDb<R> {
15771574
///
15781575
/// The returned TypeId is the `TypeId::of::<T>()` for the record type `T`
15791576
/// that was used in the corresponding `configure::<T>()` call.
1580-
#[cfg(feature = "alloc")]
15811577
pub fn collect_outbound_topic_type_ids(&self, scheme: &str) -> Vec<(String, TypeId)> {
15821578
let mut result = Vec::new();
15831579

@@ -1595,7 +1591,6 @@ impl<R: aimdb_executor::RuntimeAdapter + 'static> AimDb<R> {
15951591
result
15961592
}
15971593

1598-
#[cfg(feature = "alloc")]
15991594
pub fn collect_outbound_routes(&self, scheme: &str) -> Vec<OutboundRoute> {
16001595
let mut routes = Vec::new();
16011596

aimdb-core/src/connector.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,6 @@ pub struct ConnectorLink {
480480
/// Mirrors the producer_factory pattern used for inbound connectors.
481481
///
482482
/// Available in both `std` and `no_std + alloc` environments.
483-
#[cfg(feature = "alloc")]
484483
pub consumer_factory: Option<ConsumerFactoryFn>,
485484

486485
/// Optional dynamic topic provider
@@ -507,10 +506,7 @@ impl Debug for ConnectorLink {
507506
)
508507
.field(
509508
"consumer_factory",
510-
#[cfg(feature = "alloc")]
511509
&self.consumer_factory.as_ref().map(|_| "<function>"),
512-
#[cfg(not(feature = "alloc"))]
513-
&None::<()>,
514510
)
515511
.field(
516512
"topic_provider",
@@ -527,7 +523,6 @@ impl ConnectorLink {
527523
url,
528524
config: Vec::new(),
529525
serializer: None,
530-
#[cfg(feature = "alloc")]
531526
consumer_factory: None,
532527
topic_provider: None,
533528
}
@@ -547,7 +542,6 @@ impl ConnectorLink {
547542
/// Returns None if no factory is configured.
548543
///
549544
/// Available in both `std` and `no_std + alloc` environments.
550-
#[cfg(feature = "alloc")]
551545
pub fn create_consumer(
552546
&self,
553547
db_any: Arc<dyn core::any::Any + Send + Sync>,
@@ -598,7 +592,6 @@ pub enum DeserializerKind {
598592
/// the factory in a type-erased InboundConnectorLink.
599593
///
600594
/// Available in both `std` and `no_std + alloc` environments.
601-
#[cfg(feature = "alloc")]
602595
pub type ProducerFactoryFn =
603596
Arc<dyn Fn(Arc<dyn core::any::Any + Send + Sync>) -> Box<dyn ProducerTrait> + Send + Sync>;
604597

@@ -651,7 +644,6 @@ pub trait ProducerTrait: Send + Sync {
651644
/// Mirrors the ProducerFactoryFn pattern for symmetry between inbound and outbound.
652645
///
653646
/// Available in both `std` and `no_std + alloc` environments.
654-
#[cfg(feature = "alloc")]
655647
pub type ConsumerFactoryFn =
656648
Arc<dyn Fn(Arc<dyn core::any::Any + Send + Sync>) -> Box<dyn ConsumerTrait> + Send + Sync>;
657649

@@ -719,7 +711,6 @@ pub struct InboundConnectorLink {
719711
/// Captures the record type T at link_from() call time.
720712
///
721713
/// Available in both `std` and `no_std + alloc` environments.
722-
#[cfg(feature = "alloc")]
723714
pub producer_factory: Option<ProducerFactoryFn>,
724715

725716
/// Optional dynamic topic resolver (late-binding)
@@ -737,7 +728,6 @@ impl Clone for InboundConnectorLink {
737728
url: self.url.clone(),
738729
config: self.config.clone(),
739730
deserializer: self.deserializer.clone(),
740-
#[cfg(feature = "alloc")]
741731
producer_factory: self.producer_factory.clone(),
742732
topic_resolver: self.topic_resolver.clone(),
743733
}
@@ -765,16 +755,14 @@ impl InboundConnectorLink {
765755
url,
766756
config: Vec::new(),
767757
deserializer,
768-
#[cfg(feature = "alloc")]
769758
producer_factory: None,
770759
topic_resolver: None,
771760
}
772761
}
773762

774-
/// Sets the producer factory callback (alloc feature)
763+
/// Sets the producer factory callback.
775764
///
776765
/// Available in both `std` and `no_std + alloc` environments.
777-
#[cfg(feature = "alloc")]
778766
pub fn with_producer_factory<F>(mut self, factory: F) -> Self
779767
where
780768
F: Fn(Arc<dyn core::any::Any + Send + Sync>) -> Box<dyn ProducerTrait>
@@ -786,10 +774,9 @@ impl InboundConnectorLink {
786774
self
787775
}
788776

789-
/// Creates a producer using the stored factory (alloc feature)
777+
/// Creates a producer using the stored factory.
790778
///
791779
/// Available in both `std` and `no_std + alloc` environments.
792-
#[cfg(feature = "alloc")]
793780
pub fn create_producer(
794781
&self,
795782
db_any: Arc<dyn core::any::Any + Send + Sync>,

aimdb-core/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
1717
#![cfg_attr(not(feature = "std"), no_std)]
1818

19-
#[cfg(feature = "alloc")]
2019
extern crate alloc;
2120

2221
pub mod buffer;
@@ -74,7 +73,6 @@ pub use aimdb_executor::{
7473
pub use database::Database;
7574

7675
// Producer-Consumer Pattern exports
77-
#[cfg(feature = "alloc")]
7876
pub use builder::OutboundRoute;
7977
pub use builder::{AimDb, AimDbBuilder};
8078
pub use connector::ConnectorBuilder;
@@ -101,6 +99,5 @@ pub use record_id::{RecordId, RecordKey, StringKey};
10199
pub use graph::{DependencyGraph, EdgeType, GraphEdge, GraphNode, RecordGraphInfo, RecordOrigin};
102100

103101
// Transform API exports
104-
#[cfg(feature = "alloc")]
105102
pub use transform::{JoinBuilder, JoinEventRx, JoinPipeline, JoinTrigger};
106103
pub use transform::{TransformBuilder, TransformPipeline};

aimdb-core/src/transform/join.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ impl<R: JoinReceiver<JoinTrigger> + Send> DynJoinRx for R {
114114
// ============================================================================
115115

116116
/// Type-erased factory for creating a forwarder task for one join input.
117-
#[cfg(feature = "alloc")]
118117
type JoinInputFactory<R> = Box<
119118
dyn FnOnce(
120119
Arc<crate::AimDb<R>>,
@@ -133,13 +132,11 @@ type JoinInputFactory<R> = Box<
133132
/// internal constant chosen per adapter (Tokio: 64, Embassy: 8, WASM: 64).
134133
///
135134
/// Obtain via [`RecordRegistrar::transform_join`].
136-
#[cfg(feature = "alloc")]
137135
pub struct JoinBuilder<O, R: JoinFanInRuntime + 'static> {
138136
inputs: Vec<(String, JoinInputFactory<R>)>,
139137
_phantom: PhantomData<(O, R)>,
140138
}
141139

142-
#[cfg(feature = "alloc")]
143140
impl<O, R> JoinBuilder<O, R>
144141
where
145142
O: Send + Sync + Clone + Debug + 'static,
@@ -245,12 +242,10 @@ where
245242
///
246243
/// Produced by [`JoinBuilder::on_triggers`] and consumed by
247244
/// [`RecordRegistrar::transform_join`]. Not normally constructed directly.
248-
#[cfg(feature = "alloc")]
249245
pub struct JoinPipeline<O: Send + Sync + Clone + Debug + 'static, R: JoinFanInRuntime + 'static> {
250246
pub(crate) spawn_factory: Box<dyn FnOnce(()) -> TransformDescriptor<O, R> + Send>,
251247
}
252248

253-
#[cfg(feature = "alloc")]
254249
impl<O, R> JoinPipeline<O, R>
255250
where
256251
O: Send + Sync + Clone + Debug + 'static,
@@ -265,7 +260,6 @@ where
265260
// Join Transform Build (forwarders + handler future, both collected at build time)
266261
// ============================================================================
267262

268-
#[cfg(feature = "alloc")]
269263
#[allow(unused_variables)]
270264
fn build_join_collected<O, R, F, Fut>(
271265
db: Arc<crate::AimDb<R>>,

aimdb-core/src/transform/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ pub mod single;
2222
// Public re-exports
2323
pub use single::{StatefulTransformBuilder, TransformBuilder, TransformPipeline};
2424

25-
#[cfg(feature = "alloc")]
2625
pub use join::{JoinBuilder, JoinEventRx, JoinPipeline, JoinTrigger};
2726

2827
// ============================================================================

aimdb-core/src/typed_api.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,6 @@ where
548548
/// Register a multi-input join transform (low-level API).
549549
///
550550
/// Panics if a `.source()` or another `.transform()` is already registered.
551-
#[cfg(feature = "alloc")]
552551
pub fn transform_join_raw<F>(&'a mut self, build_fn: F) -> &'a mut Self
553552
where
554553
R: aimdb_executor::JoinFanInRuntime,
@@ -567,7 +566,6 @@ where
567566
/// Derives this record from multiple input records. Available on any runtime
568567
/// that implements `JoinFanInRuntime`. Panics if a `.source()` or another
569568
/// `.transform()` is already registered.
570-
#[cfg(feature = "alloc")]
571569
pub fn transform_join<F>(&'a mut self, build_fn: F) -> &'a mut Self
572570
where
573571
R: aimdb_executor::JoinFanInRuntime,

aimdb-core/src/typed_record.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ extern crate alloc;
2020
#[cfg(not(feature = "std"))]
2121
use alloc::{boxed::Box, sync::Arc, vec::Vec};
2222

23-
// ToString is only needed when alloc is enabled (for record_key.to_string())
24-
#[cfg(all(not(feature = "std"), feature = "alloc"))]
23+
#[cfg(not(feature = "std"))]
2524
use alloc::string::ToString;
2625

2726
#[cfg(feature = "std")]

0 commit comments

Comments
 (0)