[−][src]Struct java_properties::PropertiesWriter
Writes to a properties file.
Implementations
impl<W: Write> PropertiesWriter<W>
[src]
pub fn new(writer: W) -> Self
[src]
Writes to the given Write
stream.
pub fn new_with_encoding(writer: W, encoding: &'static dyn Encoding) -> Self
[src]
Writes to the given Write
stream in the given encoding.
Note that the Java properties specification specifies ISO-8859-1 encoding
for properties files; in most cases, new
should be called instead.
pub fn write_comment(&mut self, comment: &str) -> Result<(), PropertiesError>
[src]
Writes a comment to the file.
pub fn write(&mut self, key: &str, value: &str) -> Result<(), PropertiesError>
[src]
Writes a key/value pair to the file.
pub fn flush(&mut self) -> Result<(), PropertiesError>
[src]
Flushes the underlying stream.
pub fn set_comment_prefix(
&mut self,
prefix: &str
) -> Result<(), PropertiesError>
[src]
&mut self,
prefix: &str
) -> Result<(), PropertiesError>
Sets the comment prefix.
The prefix must contain a '#' or a '!', may only contain spaces, tabs, or form feeds before the comment character, and may not contain any carriage returns or line feeds ('\r' or '\n').
pub fn set_kv_separator(
&mut self,
separator: &str
) -> Result<(), PropertiesError>
[src]
&mut self,
separator: &str
) -> Result<(), PropertiesError>
Sets the key/value separator.
The separator may be non-empty whitespace, or a colon with optional whitespace on either side, or an equals sign with optional whitespace on either side. (Whitespace here means ' ', '\t', or '\f'.)
pub fn set_line_ending(&mut self, line_ending: LineEnding)
[src]
Sets the line ending.
Auto Trait Implementations
impl<W> !RefUnwindSafe for PropertiesWriter<W>
impl<W> !Send for PropertiesWriter<W>
impl<W> !Sync for PropertiesWriter<W>
impl<W> Unpin for PropertiesWriter<W> where
W: Unpin,
W: Unpin,
impl<W> !UnwindSafe for PropertiesWriter<W>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,