Function ruma::signatures::redact
source · [−]pub fn redact(
object: &BTreeMap<String, CanonicalJsonValue, Global>,
version: &RoomVersionId
) -> Result<BTreeMap<String, CanonicalJsonValue, Global>, Error>Expand description
Redacts an event using the rules specified in the Matrix client-server specification.
This is part of the process of signing an event.
Redaction is also suggested when a verifying an event with verify_event returns
Verified::Signatures. See the documentation for Verified for details.
Returns a new JSON object with all applicable fields redacted.
Parameters
- object: A JSON object to redact.
Errors
Returns an error if:
objectcontains a field calledcontentthat is not a JSON object.objectcontains a field calledhashesthat is not a JSON object.objectcontains a field calledsignaturesthat is not a JSON object.objectis missing thetypefield or the field is not a JSON string.
