!veagCdDBjKrMsOCzrq:privacytools.io

Ruma

68 Members
A set of Rust library crates for working with the Matrix protocol. https://www.ruma.io/ | https://github.com/ruma/ | https://liberapay.com/ruma/42 Servers

Load older messages


SenderMessageTime
9 Apr 2021
@jplatte:flipdot.orgjplatteSo maybe we should do that too08:42:20
@jplatte:flipdot.orgjplatteThen there's no need to have the signature of the fn twice08:42:36
@jplatte:flipdot.orgjplatte *
pub trait OutgoingRequestAppserviceExt: OutgoingRequest {
    // fn
}

impl<T: OutgoingRequest> OutgoingRequestAppserviceExt for T { }
08:42:52
@jplatte:flipdot.orgjplatteUpdate example code above08:42:58
@jbecker:famedly.deJohannes Becker
   | |_^ type parameter `T` must be used as the type parameter for some local type
   |
   = note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local
   = note: only traits defined in the current crate can be implemented for a type parameter
08:50:12
@jbecker:famedly.deJohannes Becker impl<T: #ruma_api::OutgoingRequest> #ruma_api::OutgoingRequestAppserviceExt for T { 08:50:55
@jplatte:flipdot.orgjplatte Err, are you declaring and implementing OutgoingRequestAppserviceExt in different crates? 08:51:03
@jplatte:flipdot.orgjplatteYou're touching the macros?08:51:20
@jbecker:famedly.deJohannes Becker i've declared OutgoingRequestAppserviceExt below OutgoingRequest 08:51:25
@jplatte:flipdot.orgjplatte
In reply to @jplatte:flipdot.org
pub trait OutgoingRequestAppserviceExt: OutgoingRequest {
    // fn
}

impl<T: OutgoingRequest> OutgoingRequestAppserviceExt for T { }
You just need to add this to ruma-api
08:51:40
@jplatte:flipdot.orgjplatteThe macro code can stay as-is08:51:53
@jbecker:famedly.deJohannes Beckeroh 🤔08:52:22
@jplatte:flipdot.orgjplatteI bet you're more used to some language with interfaces and/or inheritance than Rust, am I right? :)08:53:33
@jbecker:famedly.deJohannes Beckeryeah, but i guess the complexity here stems from finding the right mental spot for macro generated things08:55:38
@jbecker:famedly.deJohannes Becker but it makes sense given that i don't need something specific to the request in the Ext 08:56:40
@jplatte:flipdot.orgjplatteAfter fiddling with it a bunch, it doesn't seem like the serde-style approach helps much, actually. 13:09:23
@jplatte:flipdot.orgjplatte We would have to define our own replacement for the parts of http::header and http::Method we use to drop the http dependency, and I'm not keen on that 13:10:01
@jplatte:flipdot.orgjplatte * We would have to define our own replacement for the parts of http::header and http::Method we use to drop the http dependency, and I'm not keen on that 13:10:11
@jplatte:flipdot.orgjplatteIf we keep the http dependency, there is not that much of a point in changing the internal API since we can just hide the type conversions in ruma-client (and for servers we could provide similar higher-level stuff on top of the current abstractions)13:11:18
@jplatte:flipdot.orgjplatte That said, I've made some progress on replacing Vec<u8> in the API, anybody who wants to know more can follow #481 :) 13:11:49
@_neb_github:matrix.orgGithubRedacted or Malformed Event13:11:50
@jplatte:flipdot.orgjplatte * That said, I've made some progress on replacing Vec<u8> in the API, anybody who wants to know more can follow #481 :) 13:12:04
@_neb_github:matrix.orgGithubhttps://github.com/ruma/ruma/pull/481 : Rework the traits in ruma-api13:12:05
@mtrnord:nordgedanken.devMTRNord changed their profile picture.23:55:59
10 Apr 2021
@acharles:matrix.orgAhmed Charles joined the room.08:06:12
12 Apr 2021
@jbecker:famedly.deJohannes Becker
In reply to @jplatte:flipdot.org
You just need to add this to ruma-api
ended up with this for now: https://github.com/ruma/ruma/pull/495
09:50:47
@jbecker:famedly.deJohannes Beckerthanks for review and merge :311:33:40
@em:queersin.spaceEmelie | Away changed their display name from Emelie to Emelie | Away.15:52:08
13 Apr 2021
@kreha1:matrix.orgTomasz Rymkiewicz changed their display name from tomek to Tomasz Rymkiewicz.10:23:57
@jplatte:matrix.org@jplatte:matrix.org left the room.14:34:33

There are no newer messages yet.


Back to Room List