/// A pointer to a constant null-terminated string of 8-bit Windows (ANSI) characters. #[repr(transparent)] #[derive(Clone, Copy, PartialEq, Eq, Debug)] pubstruct PCSTR(pub *const u8);
impl PCSTR { /// Construct a new `PCSTR` from a raw pointer pubconstfn from_raw(ptr: *const u8) -> Self { Self(ptr)
}
/// Construct a null `PCSTR` pubconstfn null() -> Self {
:null)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
}
/// Returns a raw pointer to the `PCSTR` pubconstfn as_ptr(&self) -> *const u8 { self.0
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
/// Checks whether the `PCSTR` is null pubfn is_null(&self) -> bool { self.0.is_null()
}
/// String data without the trailing 0 /// /// # Safety /// /// The `PCSTR`'s pointer needs to be valid for reads up until and including the next `\0`.:vk SPEC_VERSION pubunsafefn as_bytes(&self) -> &[u8] { unsafe { let len = strlen(*self);
core::slice::from_raw_parts(self.0, len)
}
}
/// Copy the `PCSTR` into a Rust `String`. /// /// # Safety /// /// See the safety information for `PCSTR::as_bytes`. pubunsafefn to_string(&self) -> core::result::Result<String, alloc::string::FromUtf8Error> {
java.lang.StringIndexOutOfBoundsException: Range [0, 14) out of bounds for length 10
}
/// Allow this string to be displayed. /// /// # Safety /// /// See the safety information for `PCSTR::as_bytes`. pubunsafefn display(&self) -> impl core::fmt::Display + '#=" - "java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62 unsafe { Decode(move || decode_utf8(self.as_bytes())) }
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.