- There is a hierarchy of event traits:
Event
>RoomEvent
>StateEvent
- There is a Rust type for each kind of event (each allowed value for the 'type' field of the json representation), including custom [room / state] events
- There is also a content type for each event type
- In addition, there are "special" event types:
- the
Event
,RoomEvent
andStateEvent
enums fromcollections::all
contain every event type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// make sure to put the attributes thing there, so | |
// #[serde()] attributes are allowed for the dummy macros | |
#[proc_macro_derive(Deserialize, attributes(serde))] | |
pub fn dummy_deserialize(_input: TokenStream) -> TokenStream { | |
TokenStream::new() | |
} | |
// could maybe just export the same macro twice under the same name, | |
// here or in the re-export module, as an alternative | |
#[proc_macro_derive(Serialize, attributes(serde))] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jplatte@jp-desktop ..-sdk/bindings/matrix-sdk-crypto-nodejs (git)-[jplatte/valgrind] % valgrind --trace-children=yes node node_modules/.bin/jest --verbose --testTimeout 1000000 | |
==19597== Memcheck, a memory error detector | |
==19597== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al. | |
==19597== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info | |
==19597== Command: node node_modules/.bin/jest --verbose --testTimeout 1000000 | |
==19597== | |
==19804== | |
==19804== HEAP SUMMARY: | |
==19804== in use at exit: 4,979,697 bytes in 12,575 blocks | |
==19804== total heap usage: 118,588 allocs, 106,013 frees, 160,485,438 bytes allocated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Recursive expansion of pin_project! macro | |
// ========================================== | |
pub(crate)enum Either<A,B>{ | |
A { | |
inner:A | |
},B { | |
inner:B | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use my_crate::{Const, Trait}; | |
fn main() { | |
let _ = Const::<1>::assoc_fn(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use actix_service::{Service, Transform}; | |
use futures_util::future::{self, FutureExt as _, LocalBoxFuture}; | |
use std::{cell::RefCell, future::Future, rc::Rc}; | |
#[derive(Clone, Debug)] | |
pub struct Preprocess<F>(pub F); | |
pub struct PreprocessService<S, F> { | |
service: Rc<RefCell<S>>, | |
f: F, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swaymsg -t get_tree | jq -r '.nodes[] | select([recurse(.nodes[]?, .floating_nodes[]?) | .focused] | any) | .name' |
I hereby claim:
- I am jplatte on github.
- I am jplatte (https://keybase.io/jplatte) on keybase.
- I have a public key ASCw2BYUeQV-zliaUjaXzxRVVInsM9e0JG8EhDTe6XYd1Qo
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on https://gist.github.com/ilpropheta/7576dce4c3249df89f85 | |
// Works with: | |
// * g++ (since 4.9.2, potentially before) | |
// * clang (since 3.5, potentially before) | |
// * Visual C++ (since version 14 / 2015) | |
#ifndef _NAMED_PARAMS_HPP_ | |
#define _NAMED_PARAMS_HPP_ | |
#include <type_traits> // std::is_same |