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

Method set_mode

atomic-core/src/change/ops.rs:175–190  ·  view source on GitHub ↗

Creates a semantic mode attribute operation.

(
        trunk_id: TrunkId,
        path: String,
        mode: u16,
    )

Source from the content-addressed store, hash-verified

173
174 /// Creates a semantic mode attribute operation.
175 pub fn set_mode(
176 trunk_id: TrunkId,
177 path: String,
178 mode: u16,
179 ) -> Result<Self, crate::change::AttrValueError> {
180 crate::change::InodeAttr::Mode(mode).validate()?;
181 Ok(Self {
182 trunk_id,
183 path,
184 trunk_op: Some(TrunkOp::SetMode {
185 trunk: trunk_id,
186 mode,
187 }),
188 line_ops: Vec::new(),
189 })
190 }
191
192 /// Creates a semantic inode-kind attribute operation.
193 pub fn set_kind(trunk_id: TrunkId, path: String, kind: crate::change::InodeKind) -> Self {

Calls 2

ModeEnum · 0.85
validateMethod · 0.45