djtech

joined 1 year ago
MODERATOR OF
1
Feed me, human! (media.mstdn.social)
 
[–] djtech@lemmy.world 0 points 8 months ago (1 children)

Try updating your DM / your entire system from the emergency mode.

 

Just wanted to ask: what do you not like in Lemmy (Lemmy as communities, server and clients)?

This is just a way for me to get some feedback from the community.

[–] djtech@lemmy.world 0 points 1 year ago (1 children)

Yes, obviously, but there are de-referincing/borrwowing/trait problem.

If you want to check the Trait: https://docs.rs/ratatui/latest/ratatui/widgets/trait.Widget.html

If you want to check what function do I need to run: https://docs.rs/ratatui/latest/ratatui/terminal/struct.Frame.html#method.render_widget

So the struct is something like struct Panel<T: Widget> { data: T } (tried also with Box, Rc, &mut T and Box

I need to implement a method for Panel which simply uses the function linked above. (so just asks for a Frame, the Rect type is generated by my other function)

 

crosspostato da: https://lemmy.world/post/1916287

Hi everybody, I'm new to Rust.

So, I have a struct Panel which contains a data widget which implements the trait Widget I have to implement a function for Panel that uses another function that requires a type that implements Widget.

I tried Box<T>, Rc<T>, Box<dyn Widget, &T, but nothing, always compiler errors.

How can I fix this?