Implement UUID CRC32 and byte order compatibility
This commit is contained in:
@@ -189,6 +189,26 @@ MEMBER_TYPE_OVERRIDES = {
|
||||
),
|
||||
}
|
||||
MEMBER_SIGNATURE_OVERRIDES = {
|
||||
"M:LibreMetaverse.Utils.ReadSingleLittleEndian(System.Byte[],System.Int32)": (
|
||||
"pub fn read_single_little_endian(src: &[u8], pos: i32) -> Result<f32, crate::Error>",
|
||||
"shared_borrow,owned",
|
||||
),
|
||||
"M:LibreMetaverse.Utils.WriteSingleLittleEndian(System.Byte[],System.Int32,System.Single)": (
|
||||
"pub fn write_single_little_endian(dest: &mut [u8], pos: i32, value: f32) -> Result<(), crate::Error>",
|
||||
"mutable_borrow,owned,owned",
|
||||
),
|
||||
"M:LibreMetaverse.Utils.ReadDoubleLittleEndian(System.Byte[],System.Int32)": (
|
||||
"pub fn read_double_little_endian(src: &[u8], pos: i32) -> Result<f64, crate::Error>",
|
||||
"shared_borrow,owned",
|
||||
),
|
||||
"M:LibreMetaverse.Utils.WriteDoubleLittleEndian(System.Byte[],System.Int32,System.Double)": (
|
||||
"pub fn write_double_little_endian(dest: &mut [u8], pos: i32, value: f64) -> Result<(), crate::Error>",
|
||||
"mutable_borrow,owned,owned",
|
||||
),
|
||||
"M:LibreMetaverse.UUID.ToBytes(System.Byte[],System.Int32)": (
|
||||
"pub fn to_bytes(&self, dest: &mut [u8], pos: i32) -> Result<(), crate::Error>",
|
||||
"shared_self,mutable_borrow,owned",
|
||||
),
|
||||
"M:LibreMetaverse.AppearanceManager.#ctor(LibreMetaverse.GridClient)": (
|
||||
"pub fn new(client: Option<std::sync::Arc<libremetaverse::GridClient>>) "
|
||||
"-> Result<Self, crate::Error>",
|
||||
@@ -853,7 +873,15 @@ def validate_generated_shims() -> None:
|
||||
for body in function_bodies(text):
|
||||
if FAKE_BODY.search(body):
|
||||
raise ValueError(f"generated shim returns a plausible fallback: {path.relative_to(ROOT)}")
|
||||
if not any(marker in body for marker in ("unimplemented_api!", "not_implemented(", "NotImplemented::new(")):
|
||||
if not any(
|
||||
marker in body
|
||||
for marker in (
|
||||
"unimplemented_api!",
|
||||
"not_implemented(",
|
||||
"NotImplemented::new(",
|
||||
"crate::byte_order::",
|
||||
)
|
||||
):
|
||||
raise ValueError(f"generated shim function does not use the standardized failure: {path.relative_to(ROOT)}")
|
||||
|
||||
|
||||
@@ -983,6 +1011,8 @@ def generic_names(item: dict, owner: dict) -> set[str]:
|
||||
def method_receiver(owner: dict, item: dict) -> tuple[str, str]:
|
||||
if item.get("static") or item["kind"] == "constructor":
|
||||
return "", "none"
|
||||
if owner["doc_id"] == "T:LibreMetaverse.CRC32" and item["name"] == "Update":
|
||||
return "&mut self", "mutable_self"
|
||||
if item["name"] == "Deserialize":
|
||||
return "&mut self", "mutable_self"
|
||||
if owner["doc_id"] == "T:LibreMetaverse.Assets.AssetMaterial" and item["name"].startswith(
|
||||
|
||||
Reference in New Issue
Block a user