MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / write_world_fragments

Method write_world_fragments

crates/csharp/src/world_generator.rs:113–143  ·  view source on GitHub ↗
(
        &mut self,
        direction: Direction,
        direction_name: &str,
        src: &mut String,
        access: &str,
        name: &String,
    )

Source from the content-addressed store, hash-verified

111 }
112
113 fn write_world_fragments(
114 &mut self,
115 direction: Direction,
116 direction_name: &str,
117 src: &mut String,
118 access: &str,
119 name: &String,
120 ) {
121 if self
122 .world_fragments
123 .iter()
124 .any(|f| f.direction == Some(direction))
125 {
126 uwrite!(
127 src,
128 "
129 {access} interface I{name}World{direction_name}{{
130 "
131 );
132 src.push_str(
133 &self
134 .world_fragments
135 .iter()
136 .filter(|f| f.direction == Some(direction))
137 .map(|f| f.csharp_src.deref())
138 .collect::<Vec<_>>()
139 .join("\n"),
140 );
141 src.push_str("}\n");
142 }
143 }
144}
145
146impl WorldGenerator for CSharp {

Callers 1

finishMethod · 0.80

Calls 5

joinMethod · 0.80
mapMethod · 0.80
iterMethod · 0.45
push_strMethod · 0.45
derefMethod · 0.45

Tested by

no test coverage detected