You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// we have this structurestructDbEntry{index:usize,time:u64,text:String,}// but we wanna to print the structurepubstructEntry{index:usize,#[tabled(inline)]time:Date,text:String,}pubstructDate{y:usize,m:usize,d:usize,}
zhiburt
changed the title
Add a way to map Value into another Value rather then a String
[really good to do] Add a way to map Value into another Value rather then a String
Jan 25, 2025
But it's not the easiest issue to cover,
cause tabled_derive is not quite clean 😅 .
It's good but could be better.
You would need to take a look at how display_with implemented, the difference will be in return type of function and that's it I guess?
So maybe not that difficult then?:)
If you'll encounter problems please let me know and I'll try to help.
So we do have
#[tabled(display_with)]
which very good, but it does require us to return String.Which sometimes is not what we are looking for.
Sometimes it's valuable to convert a value into another value so it could be
#[tabled(inline)]
ed.Here's a good example from #486
So the result will be something like
I guess we need one more macro helper?
And actually it's valuable not only for
inline
case,but we could map and the value could
impl Display
so we would kind be ok with it.So yessss
Very prominent idea.
I do very like it.
The text was updated successfully, but these errors were encountered: