/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#[derive(Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] // This struct mirrors what is stored on the server pubstruct TabsRecord { // `String` instead of `SyncGuid` because some IDs are FxA device ID (XXX - that doesn't // matter though - this could easily be a Guid!) pub id: String, pub client_name: String, pub tabs: Vec<TabsRecordTab>,
}
#[cfg(test)] pubmod test { usesuper::*; use serde_json::json;
#[test] fn test_extra_fields() { let payload = json!({ "id": "JkeBPC50ZI0m", // Let's say we agree on new tabs to record, we want old versions to // ignore them! "ignoredField": "??", "clientName": "client name", "tabs": [{ "title": "the title", "urlHistory": [ "https://mozilla.org/"
], "icon": "https://mozilla.org/icon", "lastUsed": 1643764207, // Ditto - make sure we ignore unexpected fields in each tab. "ignoredField": "??",
}]
}); let record: TabsRecord = serde_json::from_value(payload).unwrap(); // The point of this test is really just to ensure the deser worked, so // just check the ID.
assert_eq!(record.id, "JkeBPC50ZI0m");
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-06-18)
¤
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.