API Workshop #3 (Rust) [2025-04-14] #919
Replies: 1 comment
-
@darkwisebear @qor-lb @MarkSchmitt @simon-acc Regarding the GAT. A better example than what I showed the last time is when you want to be generic over another generic type, e.g. This is copied from https://blog.rust-lang.org/2021/08/03/GATs-stabilization-push/ trait PointerFamily {
type Pointer<T>: Deref<Target = T>;
fn new<T>(value: T) -> Self::Pointer<T>;
}
struct ArcFamily;
struct RcFamily;
impl PointerFamily for ArcFamily {
type Pointer<T> = Arc<T>;
...
}
impl PointerFamily for RcFamily {
type Pointer<T> = Rc<T>;
...
}
struct MyStruct<P: PointerFamily> {
pointer: P::Pointer<String>,
} Here, you cannot just pass a In our case with the sample, it might also be helpful when we do not want to define whether a sample needs to be shareable between threads or if we leave it up to the user. With GAT's this would be possible since one could define this in a custom In fact, we use the same mechanism in iceoryx2 to enable a customization of the messaging pattern. One generic parameter defines all the implementations of some traits that are required to have a publish-subscribe messaging pattern and in theory, we could create a publish-subscribe service based on LoLa. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Participants
@qor-lb
@MarkSchmitt
@simon-acc
@elBoberido
@darkwisebear
Agenda
Minutes
Merge sample PR
Discussion on Reloc vs Unpin traits
Work mode / workshop / 0.5 timeline
Event API / interface grouping
Side discussion / higher level discussion
--> Question on COM level: What do we want in the long run, how do we go about 0.5?
Beta Was this translation helpful? Give feedback.
All reactions