@@ -1062,8 +1062,12 @@ impl<'a> ApplicationInfo<'a> {
1062
1062
self
1063
1063
}
1064
1064
#[inline]
1065
- pub unsafe fn application_name_as_c_str(&self) -> &core::ffi::CStr {
1066
- core::ffi::CStr::from_ptr(self.p_application_name)
1065
+ pub unsafe fn application_name_as_c_str(&self) -> Option<&core::ffi::CStr> {
1066
+ if self.p_application_name.is_null() {
1067
+ None
1068
+ } else {
1069
+ Some(core::ffi::CStr::from_ptr(self.p_application_name))
1070
+ }
1067
1071
}
1068
1072
#[inline]
1069
1073
pub fn application_version(mut self, application_version: u32) -> Self {
@@ -1076,8 +1080,12 @@ impl<'a> ApplicationInfo<'a> {
1076
1080
self
1077
1081
}
1078
1082
#[inline]
1079
- pub unsafe fn engine_name_as_c_str(&self) -> &core::ffi::CStr {
1080
- core::ffi::CStr::from_ptr(self.p_engine_name)
1083
+ pub unsafe fn engine_name_as_c_str(&self) -> Option<&core::ffi::CStr> {
1084
+ if self.p_engine_name.is_null() {
1085
+ None
1086
+ } else {
1087
+ Some(core::ffi::CStr::from_ptr(self.p_engine_name))
1088
+ }
1081
1089
}
1082
1090
#[inline]
1083
1091
pub fn engine_version(mut self, engine_version: u32) -> Self {
@@ -3755,8 +3763,12 @@ impl<'a> PipelineShaderStageCreateInfo<'a> {
3755
3763
self
3756
3764
}
3757
3765
#[inline]
3758
- pub unsafe fn name_as_c_str(&self) -> &core::ffi::CStr {
3759
- core::ffi::CStr::from_ptr(self.p_name)
3766
+ pub unsafe fn name_as_c_str(&self) -> Option<&core::ffi::CStr> {
3767
+ if self.p_name.is_null() {
3768
+ None
3769
+ } else {
3770
+ Some(core::ffi::CStr::from_ptr(self.p_name))
3771
+ }
3760
3772
}
3761
3773
#[inline]
3762
3774
pub fn specialization_info(mut self, specialization_info: &'a SpecializationInfo<'a>) -> Self {
@@ -7869,8 +7881,12 @@ impl<'a> DisplayPropertiesKHR<'a> {
7869
7881
self
7870
7882
}
7871
7883
#[inline]
7872
- pub unsafe fn display_name_as_c_str(&self) -> &core::ffi::CStr {
7873
- core::ffi::CStr::from_ptr(self.display_name)
7884
+ pub unsafe fn display_name_as_c_str(&self) -> Option<&core::ffi::CStr> {
7885
+ if self.display_name.is_null() {
7886
+ None
7887
+ } else {
7888
+ Some(core::ffi::CStr::from_ptr(self.display_name))
7889
+ }
7874
7890
}
7875
7891
#[inline]
7876
7892
pub fn physical_dimensions(mut self, physical_dimensions: Extent2D) -> Self {
@@ -9172,8 +9188,12 @@ impl<'a> DebugMarkerObjectNameInfoEXT<'a> {
9172
9188
self
9173
9189
}
9174
9190
#[inline]
9175
- pub unsafe fn object_name_as_c_str(&self) -> &core::ffi::CStr {
9176
- core::ffi::CStr::from_ptr(self.p_object_name)
9191
+ pub unsafe fn object_name_as_c_str(&self) -> Option<&core::ffi::CStr> {
9192
+ if self.p_object_name.is_null() {
9193
+ None
9194
+ } else {
9195
+ Some(core::ffi::CStr::from_ptr(self.p_object_name))
9196
+ }
9177
9197
}
9178
9198
}
9179
9199
#[repr(C)]
@@ -9266,8 +9286,12 @@ impl<'a> DebugMarkerMarkerInfoEXT<'a> {
9266
9286
self
9267
9287
}
9268
9288
#[inline]
9269
- pub unsafe fn marker_name_as_c_str(&self) -> &core::ffi::CStr {
9270
- core::ffi::CStr::from_ptr(self.p_marker_name)
9289
+ pub unsafe fn marker_name_as_c_str(&self) -> Option<&core::ffi::CStr> {
9290
+ if self.p_marker_name.is_null() {
9291
+ None
9292
+ } else {
9293
+ Some(core::ffi::CStr::from_ptr(self.p_marker_name))
9294
+ }
9271
9295
}
9272
9296
#[inline]
9273
9297
pub fn color(mut self, color: [f32; 4]) -> Self {
@@ -18726,8 +18750,12 @@ impl<'a> DebugUtilsObjectNameInfoEXT<'a> {
18726
18750
self
18727
18751
}
18728
18752
#[inline]
18729
- pub unsafe fn object_name_as_c_str(&self) -> &core::ffi::CStr {
18730
- core::ffi::CStr::from_ptr(self.p_object_name)
18753
+ pub unsafe fn object_name_as_c_str(&self) -> Option<&core::ffi::CStr> {
18754
+ if self.p_object_name.is_null() {
18755
+ None
18756
+ } else {
18757
+ Some(core::ffi::CStr::from_ptr(self.p_object_name))
18758
+ }
18731
18759
}
18732
18760
}
18733
18761
#[repr(C)]
@@ -18816,8 +18844,12 @@ impl<'a> DebugUtilsLabelEXT<'a> {
18816
18844
self
18817
18845
}
18818
18846
#[inline]
18819
- pub unsafe fn label_name_as_c_str(&self) -> &core::ffi::CStr {
18820
- core::ffi::CStr::from_ptr(self.p_label_name)
18847
+ pub unsafe fn label_name_as_c_str(&self) -> Option<&core::ffi::CStr> {
18848
+ if self.p_label_name.is_null() {
18849
+ None
18850
+ } else {
18851
+ Some(core::ffi::CStr::from_ptr(self.p_label_name))
18852
+ }
18821
18853
}
18822
18854
#[inline]
18823
18855
pub fn color(mut self, color: [f32; 4]) -> Self {
@@ -18961,8 +18993,12 @@ impl<'a> DebugUtilsMessengerCallbackDataEXT<'a> {
18961
18993
self
18962
18994
}
18963
18995
#[inline]
18964
- pub unsafe fn message_id_name_as_c_str(&self) -> &core::ffi::CStr {
18965
- core::ffi::CStr::from_ptr(self.p_message_id_name)
18996
+ pub unsafe fn message_id_name_as_c_str(&self) -> Option<&core::ffi::CStr> {
18997
+ if self.p_message_id_name.is_null() {
18998
+ None
18999
+ } else {
19000
+ Some(core::ffi::CStr::from_ptr(self.p_message_id_name))
19001
+ }
18966
19002
}
18967
19003
#[inline]
18968
19004
pub fn message_id_number(mut self, message_id_number: i32) -> Self {
@@ -18975,8 +19011,12 @@ impl<'a> DebugUtilsMessengerCallbackDataEXT<'a> {
18975
19011
self
18976
19012
}
18977
19013
#[inline]
18978
- pub unsafe fn message_as_c_str(&self) -> &core::ffi::CStr {
18979
- core::ffi::CStr::from_ptr(self.p_message)
19014
+ pub unsafe fn message_as_c_str(&self) -> Option<&core::ffi::CStr> {
19015
+ if self.p_message.is_null() {
19016
+ None
19017
+ } else {
19018
+ Some(core::ffi::CStr::from_ptr(self.p_message))
19019
+ }
18980
19020
}
18981
19021
#[inline]
18982
19022
pub fn queue_labels(mut self, queue_labels: &'a [DebugUtilsLabelEXT<'a>]) -> Self {
@@ -42334,8 +42374,12 @@ impl<'a> CuFunctionCreateInfoNVX<'a> {
42334
42374
self
42335
42375
}
42336
42376
#[inline]
42337
- pub unsafe fn name_as_c_str(&self) -> &core::ffi::CStr {
42338
- core::ffi::CStr::from_ptr(self.p_name)
42377
+ pub unsafe fn name_as_c_str(&self) -> Option<&core::ffi::CStr> {
42378
+ if self.p_name.is_null() {
42379
+ None
42380
+ } else {
42381
+ Some(core::ffi::CStr::from_ptr(self.p_name))
42382
+ }
42339
42383
}
42340
42384
}
42341
42385
#[repr(C)]
@@ -44790,8 +44834,12 @@ impl<'a> CudaFunctionCreateInfoNV<'a> {
44790
44834
self
44791
44835
}
44792
44836
#[inline]
44793
- pub unsafe fn name_as_c_str(&self) -> &core::ffi::CStr {
44794
- core::ffi::CStr::from_ptr(self.p_name)
44837
+ pub unsafe fn name_as_c_str(&self) -> Option<&core::ffi::CStr> {
44838
+ if self.p_name.is_null() {
44839
+ None
44840
+ } else {
44841
+ Some(core::ffi::CStr::from_ptr(self.p_name))
44842
+ }
44795
44843
}
44796
44844
}
44797
44845
#[repr(C)]
@@ -51450,8 +51498,12 @@ impl<'a> ShaderCreateInfoEXT<'a> {
51450
51498
self
51451
51499
}
51452
51500
#[inline]
51453
- pub unsafe fn name_as_c_str(&self) -> &core::ffi::CStr {
51454
- core::ffi::CStr::from_ptr(self.p_name)
51501
+ pub unsafe fn name_as_c_str(&self) -> Option<&core::ffi::CStr> {
51502
+ if self.p_name.is_null() {
51503
+ None
51504
+ } else {
51505
+ Some(core::ffi::CStr::from_ptr(self.p_name))
51506
+ }
51455
51507
}
51456
51508
#[inline]
51457
51509
pub fn set_layouts(mut self, set_layouts: &'a [DescriptorSetLayout]) -> Self {
@@ -52262,8 +52314,12 @@ impl<'a> PipelineShaderStageNodeCreateInfoAMDX<'a> {
52262
52314
self
52263
52315
}
52264
52316
#[inline]
52265
- pub unsafe fn name_as_c_str(&self) -> &core::ffi::CStr {
52266
- core::ffi::CStr::from_ptr(self.p_name)
52317
+ pub unsafe fn name_as_c_str(&self) -> Option<&core::ffi::CStr> {
52318
+ if self.p_name.is_null() {
52319
+ None
52320
+ } else {
52321
+ Some(core::ffi::CStr::from_ptr(self.p_name))
52322
+ }
52267
52323
}
52268
52324
#[inline]
52269
52325
pub fn index(mut self, index: u32) -> Self {
0 commit comments