pub struct CircuitFile {
pub package_name: String,
}
Fields§
§package_name: String
Implementations§
Source§impl CircuitFile
impl CircuitFile
pub fn new(package_name: &str) -> Self
pub fn exists_at(&self, path: &Path) -> bool
Sourcepub fn read_from(&self, path: &Path) -> Result<String>
pub fn read_from(&self, path: &Path) -> Result<String>
Reads the serialized struct from the given file path if it exists.
Sourcepub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
pub fn write_to(&self, path: &Path, circuit: String) -> Result<()>
Writes the given serialized struct to a file.
Sourcepub fn remove(&self, path: &Path) -> Result<bool>
pub fn remove(&self, path: &Path) -> Result<bool>
Removes the serialized struct at the given path if it exists. Returns true
on success,
false
if the file doesn’t exist, and Error
if the file system fails during operation.
fn setup_file_path<'a>(&self, path: &'a Path) -> Cow<'a, Path>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CircuitFile
impl<'de> Deserialize<'de> for CircuitFile
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CircuitFile
impl RefUnwindSafe for CircuitFile
impl Send for CircuitFile
impl Sync for CircuitFile
impl Unpin for CircuitFile
impl UnwindSafe for CircuitFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
fn take_from_value<D>(
value: &mut Value,
field: &str,
) -> Result<T, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more