diff --git a/README.md b/README.md index 277486d09..2e19b162e 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,7 @@ Roblox Lua implementation of DOM APIs, allowing Instance reflection from inside | Ref | `Model.PrimaryPart` | ✔ | ✔ | ✔ | ✔ | | Region3 | N/A | ✔ | ✔ | ❌ | ❌ | | Region3int16 | `Terrain.MaxExtents` | ✔ | ✔ | ❌ | ❌ | +| SecurityCapabilities | `Folder.SecurityCapabilities` | ✔ | ❌ | ❌ | ❌ | | SharedString | N/A | ✔ | ✔ | ✔ | ✔ | | String | `Instance.Name` | ✔ | ✔ | ✔ | ✔ | | UDim | `UIListLayout.Padding` | ✔ | ✔ | ✔ | ✔ | diff --git a/rbx_types/CHANGELOG.md b/rbx_types/CHANGELOG.md index b0018f448..9195c7754 100644 --- a/rbx_types/CHANGELOG.md +++ b/rbx_types/CHANGELOG.md @@ -1,11 +1,13 @@ # rbx_types Changelog ## Unreleased Changes -* Implement `FromStr` for `TerrainMaterials`. ([#354]) +* Implemented `FromStr` for `TerrainMaterials`. ([#354]) * `MaterialColorsError` and `UniqueIdError` are no longer publicly exposed. ([#355]) +* Implemented barebones `SecurityCapabilities`. ([#358]) [#354]: https://github.com/rojo-rbx/rbx-dom/pull/354 [#355]: https://github.com/rojo-rbx/rbx-dom/pull/355 +[#358]: https://github.com/rojo-rbx/rbx-dom/pull/358 ## 1.6.0 (2023-08-09) * Added support for `UniqueId` values. ([#271]) diff --git a/rbx_types/src/lib.rs b/rbx_types/src/lib.rs index 4b30130b1..1b2c90597 100644 --- a/rbx_types/src/lib.rs +++ b/rbx_types/src/lib.rs @@ -15,6 +15,7 @@ mod lister; mod material_colors; mod physical_properties; mod referent; +mod security_capabilities; mod shared_string; mod tags; mod unique_id; @@ -32,6 +33,7 @@ pub use font::*; pub use material_colors::*; pub use physical_properties::*; pub use referent::*; +pub use security_capabilities::*; pub use shared_string::*; pub use tags::*; pub use unique_id::*; diff --git a/rbx_types/src/security_capabilities.rs b/rbx_types/src/security_capabilities.rs new file mode 100644 index 000000000..05a682a43 --- /dev/null +++ b/rbx_types/src/security_capabilities.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Copy, Default, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] +#[cfg_attr( + feature = "serde", + derive(serde::Serialize, serde::Deserialize), + serde(transparent) +)] +pub struct SecurityCapabilities { + value: u64, +} + +impl SecurityCapabilities { + pub fn from_bits(value: u64) -> Self { + SecurityCapabilities { value } + } + + pub fn bits(self) -> u64 { + self.value + } +} diff --git a/rbx_types/src/variant.rs b/rbx_types/src/variant.rs index 9f216437f..9dd3155be 100644 --- a/rbx_types/src/variant.rs +++ b/rbx_types/src/variant.rs @@ -1,8 +1,8 @@ use crate::{ Attributes, Axes, BinaryString, BrickColor, CFrame, Color3, Color3uint8, ColorSequence, Content, Enum, Faces, Font, MaterialColors, NumberRange, NumberSequence, PhysicalProperties, - Ray, Rect, Ref, Region3, Region3int16, SharedString, Tags, UDim, UDim2, UniqueId, Vector2, - Vector2int16, Vector3, Vector3int16, + Ray, Rect, Ref, Region3, Region3int16, SecurityCapabilities, SharedString, Tags, UDim, UDim2, + UniqueId, Vector2, Vector2int16, Vector3, Vector3int16, }; /// Reduces boilerplate from listing different values of Variant by wrapping @@ -132,6 +132,7 @@ make_variant! { Font(Font), UniqueId(UniqueId), MaterialColors(MaterialColors), + SecurityCapabilities(SecurityCapabilities), } impl From<&'_ str> for Variant {