MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / op

Method op

atomic-core/src/change/format_v3/graph_fields/encode.rs:107–260  ·  view source on GitHub ↗
(&mut self, op: &CompactGraphOp)

Source from the content-addressed store, hash-verified

105 Ok(())
106 }
107 fn op(&mut self, op: &CompactGraphOp) -> FormatResult<()> {
108 op.validate_serialized_name_conflict()
109 .map_err(|reason| FormatError::InvalidGraphOp {
110 operation: op.type_name(),
111 reason,
112 })?;
113 use CompactGraphOp::*;
114 match op {
115 FileAdd {
116 add_name,
117 add_inode,
118 contents,
119 path,
120 encoding,
121 } => {
122 put(&mut self.control, 0);
123 self.insertion(0, add_name)?;
124 self.insertion(1, add_inode)?;
125 self.optional_insertion(2, contents)?;
126 self.path(path)?;
127 self.aux(encoding)?;
128 }
129 DirAdd {
130 add_name,
131 add_inode,
132 path,
133 } => {
134 put(&mut self.control, 1);
135 self.insertion(0, add_name)?;
136 self.insertion(1, add_inode)?;
137 self.path(path)?;
138 }
139 DirDel { del, path } => {
140 put(&mut self.control, 2);
141 self.edges(0, del)?;
142 self.path(path)?;
143 }
144 DirUndel { undel, path } => {
145 put(&mut self.control, 3);
146 self.edges(2, undel)?;
147 self.path(path)?;
148 }
149 FileDel {
150 del,
151 contents,
152 path,
153 encoding,
154 } => {
155 put(&mut self.control, 4);
156 self.edges(0, del)?;
157 self.optional_edges(1, contents)?;
158 self.path(path)?;
159 self.aux(encoding)?;
160 }
161 FileUndel {
162 undel,
163 contents,
164 path,

Callers 1

encodeFunction · 0.45

Calls 11

putFunction · 0.70
type_nameMethod · 0.45
insertionMethod · 0.45
optional_insertionMethod · 0.45
pathMethod · 0.45
auxMethod · 0.45
edgesMethod · 0.45
optional_edgesMethod · 0.45
localMethod · 0.45
positionMethod · 0.45

Tested by

no test coverage detected