fn existing_layer_strategy(
        &self,
        context: &BuildContext<Self::Buildpack>,
        layer_data: &LayerData<Self::Metadata>,
    ) -> Result<ExistingLayerStrategy, <Self::Buildpack as Buildpack>::Error> {
        Ok(ExistingLayerStrategy::Recreate)
    }
/// This method will be called by libcnb when the layer already exists to determine the strategy
/// used to deal with it. Implementations of this method can use the current layer contents and
/// metadata to make that decision.
///
/// This can be used to invalidate a layer based on metadata. For example, the layer metadata
/// could contain a language runtime version string. If the version requested by the user is
/// different, this method should can return [`ExistingLayerStrategy::Recreate`], causing a new
/// language runtime version to be installed from scratch. Conversely, if the metadata matches,
/// this method can return [`ExistingLayerStrategy::Keep`], causing the layer to stay as-is and
/// no calls to [`crate`](Layer::create) or [`update`](Layer::update) will be made.
///
/// It can also be used cause a call to [`update`](Layer::update), updating the contents of the
/// existing layer. Installing additional application dependencies with a package manager is
/// one common case where this strategy makes sense. Implementations need to return
/// [`ExistingLayerStrategy::Update`] to trigger that behavior.
///
///
/// When not implemented, the default implementation will return
/// [`ExistingLayerStrategy::Recreate`], causing the layer to be recreated from scratch every
/// time.
///
/// # Implementation Requirements
/// Implementations **MUST NOT** modify the file-system.
This method will be called by libcnb when the layer already exists to determine the strategy
used to deal with it. Implementations of this method can use the current layer contents and
metadata to make that decision.

This can be used to invalidate a layer based on metadata. For example, the layer metadata
could contain a language runtime version string. If the version requested by the user is
different, this method should can return [`ExistingLayerStrategy::Recreate`], causing a new
language runtime version to be installed from scratch.

It can also be used cause a call to [`update`](Layer::update), updating the contents of the
existing layer. Installing additional application dependencies with a package manager is
one common case where this strategy makes sense. Implementations need to return
[`ExistingLayerStrategy::Update`] to trigger that behavior.

When not implemented, the default implementation will return
[`ExistingLayerStrategy::Recreate`], causing the layer to be recreated from scratch every
time.
This method will be called by libcnb when the layer already exists to determine the strategy used to deal with it . Implementations of this method can use the current layer contents and metadata to make that decision . This can be used to invalidate a layer based on metadata . For example the layer metadata could contain a language runtime version string . If the version requested by the user is different this method should can return [ ` ExistingLayerStrategy :: Recreate ` ] causing a new language runtime version to be installed from scratch . It can also be used cause a call to [ ` update ` ] ( Layer :: update ) updating the contents of the existing layer . Installing additional application dependencies with a package manager is one common case where this strategy makes sense . Implementations need to return [ ` ExistingLayerStrategy :: Update ` ] to trigger that behavior . When not implemented the default implementation will return [ ` ExistingLayerStrategy :: Recreate ` ] causing the layer to be recreated from scratch every time .
fn existing_layer_strategy(
        &self,
        context: &BuildContext<Self::Buildpack>,
        layer_data: &LayerData<Self::Metadata>,
    ) -> Result<ExistingLayerStrategy, <Self::Buildpack as Buildpack>::Error> {
        Ok(ExistingLayerStrategy::Recreate)
    }
fn existing_layer_strategy ( & self , context : & BuildContext < Self :: Buildpack > , layer_data : & LayerData < Self :: Metadata > , ) -> Result < ExistingLayerStrategy , < Self :: Buildpack as Buildpack > :: Error > { Ok ( ExistingLayerStrategy :: Recreate ) }
This method will be called by libcnb when the layer already exists to determine the strategy
used to deal with it.
This method will be called by libcnb when the layer already exists to determine the strategy used to deal with it .
&self
context
&BuildContext<Self::Buildpack>
layer_data
&LayerData<Self::Metadata>
&self
context
&BuildContext<Self::Buildpack>
layer_data
&LayerData<Self::Metadata>
implementation requirements
Implementations **MUST NOT** modify the file-system.
Implementations ** MUST NOT ** modify the file - system .