MCPcopy Create free account
hub / github.com/PerroEngine/Perro / fmt

Method fmt

perro_source/api_modules/perro_resource_api/src/res_path.rs:35–48  ·  view source on GitHub ↗
(&self, f: &mut fmt::Formatter<'_>)

Source from the content-addressed store, hash-verified

33
34impl fmt::Display for ResPathError {
35 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
36 let message = match self {
37 Self::Empty => "resource path is empty",
38 Self::MissingScheme => "resource path must start with res://, dlc://, or user://",
39 Self::UnknownScheme => "resource path scheme must be res, dlc, or user",
40 Self::EmptyPath => "resource path body is empty",
41 Self::EmptyDlcName => "dlc resource path needs a dlc name or self",
42 Self::InvalidDlcName => "dlc resource path name has invalid characters",
43 Self::InvalidSeparator => "resource path must use / separators",
44 Self::Traversal => "resource path cannot contain . or .. path segments",
45 Self::ControlCharacter => "resource path cannot contain control characters",
46 };
47 f.write_str(message)
48 }
49}
50
51impl std::error::Error for ResPathError {}

Callers

nothing calls this directly

Calls 2

finishMethod · 0.80
as_strMethod · 0.45

Tested by

no test coverage detected