Community stream
Community
Why would `as_ref()` be required here rather than a reference?
After playing around with newtypes a bit, I'm curious about this use of the AsRef trait: impl PaliSearcher { pub fn new(index: &PaliIndex) -> Result<Self> { let reader = Self::reader(index.as_ref())?; let uid = index.uid_field()?; let contents =…
Correct format to use on a 'scene' file
Just got me wondering, similar to Godot's scene (.tscn) what existing format would be just as convenient when implementing a similar thing, which is to handle 'Node' trees and instancing another scene instead of writing your own custom format? i…
Convert ref-to-raw-pointer to ref-to-NonNull without transmute?
Consider this toy function: fn ptr_as_nonnull<T: ?Sized>(input: &*mut T) -> Option<&NonNull<T>> { if input.is_null() { None } else { // Is it possible to implement this without transmute? Some(unsafe { std::mem::transmute(input) }) } } Is that…
Render pipeline error wgpu
let render_pipeline_layout = device.create_pipeline_layout(&PipelineLayoutDescriptor { label: None, bind_group_layouts: &[Some(&default_bgl), Some(&camera_bgl)], immediate_size: 0, }); let shader = device.create_shader_module(include_wgsl!("shaders/s…
Why no Dependent Matrix Type?
Hello, I don't really know how to really introduce this topic. Background: I want to implement compile time safe matrix multiplication. For that i want to have a struct with const generics for the number of columns and rows. Then i want a function…
Rust abstractions for kernel sources
Hi, I just got my my kernel Rust enabled and have compiled a working minimal LKM, but see that I now need access to some of the kernel calls under the net framework. Which leads me to believe I need to create some Rust abstractions so that I can…
Trait object with associated types in field - requires generic param?
I currently have: trait ListModel { fn get_stuff(&self, row: i) -> Stuff; ... } struct List { model: Rc<dyn ListModel>, ... } I think I want to change my model to use row IDs instead of usize indices. If I do this: trait ListModel { type Key: Eq +…
Any thin wrapper around the Web Worker API?
Hi, I'm currently writing some audio decoding pipeline targeting wasm32-unknown-unknown. In the queue / jittering part, I wanna be able to have one task that pushes data as it comes (with all the network uncertainties), and another parallel task…
444 items available