我想这样做。
#[repr(u8)]
pub enum MessageType {
Authentification,
// ...
}
fn main() {
let message_type = MessageType::Authentification;
let binary_representation: u8 = message_type.into();
}
Run Code Online (Sandbox Code Playgroud)
我认为自己有义务亲自实施。
有谁有一个解决方案可以使用表示来转换我的类型。
我认为在不安全的情况下这样做是可能的,但我宁愿不这样做。
对于文化来说,这仍然很有趣。
我试图从名为的材料设计组件中删除下划线TextInputLayout。我已经尝试了来自 SO 的几种不同答案,但对我来说没有用,所以我决定提出自己的问题。
我怎样才能删除这个下划线?
XML:
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/_10sdp"
style="?colorOnPrimary"
app:boxCornerRadiusTopEnd="@dimen/_5sdp"
app:boxCornerRadiusTopStart="@dimen/_5sdp"
app:startIconContentDescription="Heading">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/input_heading"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/ubuntubold"
android:hint="Heading"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
Run Code Online (Sandbox Code Playgroud) 我正在制作一个加壳器(运行时压缩)来研究Windows PE格式文件。我知道一些数据压缩算法,例如 RLE、LZW、霍夫曼编码等。但是哪种算法最适合压缩二进制数据(例如文件).exe?谁能建议哪种算法是压缩二进制数据的最佳算法?