~spacekookie

Berlin | Edinburgh

https://spacekookie.de

Mediocre programmer extraordinaire [she/her] 🏴 Compilers are your friends. Sometimes I type things into computers to make them sad. I also do Rust things. Books are my drugs 📚

Feel free to send me patches to my public inbox or open issues to any of my projects on the meta tracker!

555F 2E4B 6F87 F91A 4110 669E 9073 4A9E 619C 8A6C

Trackers

~spacekookie/meta

Last active 1 year, 11 months ago

#6 Serialize Uint type 2 months ago

Ticket created by ~spacekookie on ~tdeo/serde_bare

Hey, this is more of a question than a ticket but I need to serialise some structs to have variable length number types in the generated binary. I see that serde_bare exposes a Uint type, but I don't see an obvious way to use it.

Is this possible with serde_bare? If so, what am I missing?

Thanks!

#5 Support deserialising externally tagged enums 3 months ago

Comment by ~spacekookie on ~tdeo/serde_bare

Hi, I'm not sure I understand. You can just remove your #[serde(tag = "protocol", content = "data", rename_all = "snake_case")] and it will be serialized correctly, into a BARE tagged union.

Yes, I am aware. But this is not possible in the constraints that I'm working in. Basically we need externally tagged type information for cross-language compatibility. I was hoping that I could use this serde feature but I understand why I can't. I ended up writing my own abstraction that wraps any payload into a carrier payload struct that has "protocol" and "data" fields (where there's no ambiguity about what is being parsed).

REPORTED RESOLVED FIXED

#5 Support deserialising externally tagged enums 3 months ago

Comment by ~spacekookie on ~tdeo/serde_bare

Hey! Thank you for diving into this issue so deeply. So basically the only consistent way to serialise and deserialise these types is to have each enum variant I want to exist be a concrete type and then do matching on the protocol field in the wrapping message myself. That is a bit unfortunate, but it sounds like a part of the main design of how bare works...

#5 Support deserialising externally tagged enums 3 months ago

Ticket created by ~spacekookie on ~tdeo/serde_bare

Hey there,

it doesn't seem to be possible to deserialise an externally tagged enum with serde_bare.

Given the enum:

#[derive(Serialize, Deserialize)]
#[serde(tag = "protocol", content = "data", rename_all = "snake_case")]
pub enum MyProtocol {
    Start { name: Option<String> },
    Confirm { name: String },
}

Serialising this enum works and results in the equivalent of the following encoding schema:

type Payload {
    protocol: string
    data: data
}

But deserialising this enum type does not work and crashes with the following error:

panicked at 'called `Result::unwrap()` on an `Err` value: Message("invalid value: integer `21`, expected variant index 0 <= i < 6")'

Do you know why this is happening?

#239 Plaintext README is rendered as markdown 1 year, 9 months ago

Comment by ~spacekookie on ~sircmpwn/git.sr.ht

#239 Plaintext README is rendered as markdown 1 year, 9 months ago

Ticket created by ~spacekookie on ~sircmpwn/git.sr.ht

I have a repo where I have a README file that should be rendered as plain text, but is being rendered as markdown.

For context, this is the repo: https://git.sr.ht/~spacekookie/libkookie

#103 Anonymous users can't do most write activities 1 year, 11 months ago

Comment by ~spacekookie on ~sircmpwn/todo.sr.ht

While I do like the idea of e-mail issue reporting, I do think that anonymous tickets are important too. Considering how easy it's to create an account, I don't think that just letting anyone post an issue is really that much worse when it comes to spam.

#123 Optionally remove namespaces 1 year, 11 months ago

Ticket created by ~spacekookie on ~sircmpwn/meta.sr.ht

For projects hosting their own sourcehut it would be really useful to disable namespaces to get rid of redundant elements in the path (i.e. git.project.net/project/repo) and instead putting everything in the root namespace (git.project.net/repo)

#121 Deleting accounts 2 years ago

Ticket created by ~spacekookie on ~sircmpwn/meta.sr.ht

It should be possible to delete accounts.

To implement this we'll have to set up a profile:delete webhook and update all of the services to support it.

We may also want to look into webhook re-delivery (or at least monitoring delivery failures) before we introduce this.

#31 Mirroring repos to other remotes (e.g. GitHub) 2 years ago

Comment by ~spacekookie on ~sircmpwn/dispatch.sr.ht

Why did you mark this as wont_fix ~pwr?