性格特征中的常量表达? 我有一个如下所示的特征: pub trait Buf { fn to_buf(&self) -> [u8; N]; fn from_buf(buf: [u8; N]) -> Self; } 然而,我想这样做: trait Buf { const N: usize; fn to_buf(&self) -> [u8; Se .. 发布时间:2022-05-25 20:19:21 rust traits const-generics 其他开发