pub struct ShellLink { /* private fields */ }
Expand description
A shell link
Implementations§
Source§impl ShellLink
impl ShellLink
Sourcepub fn new<P: AsRef<Path>>(
target: P,
arguments: Option<String>,
custom_name: Option<String>,
icon_path: Option<String>,
) -> Result<Self, MSLinkError>
pub fn new<P: AsRef<Path>>( target: P, arguments: Option<String>, custom_name: Option<String>, icon_path: Option<String>, ) -> Result<Self, MSLinkError>
Create a new ShellLink pointing to a location, with otherwise default settings.
Sourcepub fn create_lnk<P: AsRef<Path>>(&self, path: P) -> Result<(), MSLinkError>
pub fn create_lnk<P: AsRef<Path>>(&self, path: P) -> Result<(), MSLinkError>
Save a shell link.
Note that this doesn’t save any ExtraData
entries.
Sourcepub fn linktarget_mut(&mut self) -> Option<&mut LinkTargetIdList>
pub fn linktarget_mut(&mut self) -> Option<&mut LinkTargetIdList>
Get a mutable instance of the shell link’s target
Sourcepub fn header(&self) -> &ShellLinkHeader
pub fn header(&self) -> &ShellLinkHeader
Get the header of the shell link
Sourcepub fn header_mut(&mut self) -> &mut ShellLinkHeader
pub fn header_mut(&mut self) -> &mut ShellLinkHeader
Get a mutable instance of the shell link’s header
Sourcepub fn relative_path(&self) -> &Option<String>
pub fn relative_path(&self) -> &Option<String>
Get the shell link’s relative path, if set
Sourcepub fn set_relative_path(&mut self, relative_path: Option<String>)
pub fn set_relative_path(&mut self, relative_path: Option<String>)
Set the shell link’s relative path
Sourcepub fn working_dir(&self) -> &Option<String>
pub fn working_dir(&self) -> &Option<String>
Get the shell link’s working directory, if set
Sourcepub fn set_working_dir(&mut self, working_dir: Option<String>)
pub fn set_working_dir(&mut self, working_dir: Option<String>)
Set the shell link’s working directory
Sourcepub fn set_arguments(&mut self, arguments: Option<String>)
pub fn set_arguments(&mut self, arguments: Option<String>)
Set the shell link’s arguments
Sourcepub fn icon_location(&self) -> &Option<String>
pub fn icon_location(&self) -> &Option<String>
Get the shell link’s icon location, if set
Sourcepub fn set_icon_location(&mut self, icon_location: Option<String>)
pub fn set_icon_location(&mut self, icon_location: Option<String>)
Set the shell link’s icon location
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ShellLink
impl RefUnwindSafe for ShellLink
impl Send for ShellLink
impl Sync for ShellLink
impl Unpin for ShellLink
impl UnwindSafe for ShellLink
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